基于gatsby入门博客的针对我的Gatsby应用程序的Netlify部署失败

时间:2019-07-12 09:40:24

标签: gatsby netlify

我使用Gatsby入门博客作为我的网站。上一次尝试部署时,出现以下错误。

1:54:59 PM: error
1:54:59 PM: Your plugins must export known APIs from their gatsby-node.js.
1:54:59 PM: The following exports aren't APIs. Perhaps you made a typo or your plugin is outdated?
1:54:59 PM: See https://www.gatsbyjs.org/docs/node-apis/ for the list of Gatsby Node APIs
1:54:59 PM: - The plugin "gatsby-source-filesystem@2.1.4" is exporting a variable named "createSchemaCustomization" which isn't an API.
1:54:59 PM: - The plugin "gatsby-source-filesystem@2.1.4" is exporting a variable named "createSchemaCustomization" which isn't an API.

我清除了缓存并尝试再次部署,但是问题没有解决。

当我尝试在笔记本电脑上构建项目时,一切都很好。如何解决该问题?

我的project files are on github,以便您检查它们。

1 个答案:

答案 0 :(得分:0)

gatsby-source-filesystem版本使用的是Gatsby的API版本,该版本要求的版本高于依赖项中的版本。直到Gatsby@^2.12.0及更高版本才引入createSchemaCustomizationgatsby-source-filesystem的对等依赖项应进行更新以反映这一点,但是目前仅将其设置为^2.0.0,因此它没有给您警告。

使用以下命令将Gatsby版本更新为最新版本或兼容版本(2.12以上):

yarn add gatsby@latest

然后确保将yarn.lockpackage.json推送到您的存储库中,以便Netlify在构建过程中使用正确的版本。

相关问题