小编Max*_*ler的帖子

安装 Gatsby Starter 时出错“安装“sharp”模块时出错”

问题

\n

我正在尝试在 Windows 上建立一个 Gatsby 入门项目。具体来说,这个入门项目:https://www.gatsbyjs.com/starters/hasura/gatsby-gitbook-starter/

\n

版本:

\n

节点:v14.10.1\nnpm:6.14.8\nGatsby CLI 版本:2.12.99\nGatsby 版本:2.18.10

\n

产生错误的初始步骤:

\n

我打开一个新终端并根据文档运行 Gatsby Starter 脚本:

\n
"gatsby new gatsby-gitbook-starter https://github.com/hasura/gatsby-gitbook-starter"\n
Run Code Online (Sandbox Code Playgroud)\n

成功克隆初始启动程序后,系统指示我 cd 进入该目录并运行“gatsby-develop”。

\n

这会引发以下错误:

\n
success open and validate gatsby-configs - 0.081s\n\n ERROR \n\n\nSomething went wrong installing the "sharp" module\n\nCannot find module \'../build/Release/sharp.node\'\nRequire stack:\n- C:\\code\\Sutro\\gatsby-gitbook-starter2\\node_modules\\sharp\\lib\\constructor.js\n- C:\\code\\Sutro\\gatsby-gitbook-starter2\\node_modules\\sharp\\lib\\index.js\n- C:\\code\\Sutro\\gatsby-gitbook-starter2\\node_modules\\gatsby-plugin-sharp\\safe-sharp.js\n- C:\\code\\Sutro\\gatsby-gitbook-starter2\\node_modules\\gatsby-plugin-sharp\\index.js\n- C:\\code\\Sutro\\gatsby-gitbook-starter2\\node_modules\\gatsby-plugin-sharp\\gatsby-node.js\n- C:\\code\\Sutro\\gatsby-gitbook-starter2\\node_modules\\gatsby\\dist\\bootstrap\\resolve-module-exports.js\n- C:\\code\\Sutro\\gatsby-gitbook-starter2\\node_modules\\gatsby\\dist\\bootstrap\\load-plugins\\validate.js\n- C:\\code\\Sutro\\gatsby-gitbook-starter2\\node_modules\\gatsby\\dist\\bootstrap\\load-plugins\\load.js\n- C:\\code\\Sutro\\gatsby-gitbook-starter2\\node_modules\\gatsby\\dist\\bootstrap\\load-plugins\\index.js\n- C:\\code\\Sutro\\gatsby-gitbook-starter2\\node_modules\\gatsby\\dist\\bootstrap\\index.js\n- C:\\code\\Sutro\\gatsby-gitbook-starter2\\node_modules\\gatsby\\dist\\commands\\develop.js\n- C:\\Users\\mxgel\\AppData\\Roaming\\npm\\node_modules\\gatsby-cli\\lib\\create-cli.js\n- C:\\Users\\mxgel\\AppData\\Roaming\\npm\\node_modules\\gatsby-cli\\lib\\index.js\n- C:\\Users\\mxgel\\AppData\\Roaming\\npm\\node_modules\\gatsby-cli\\cli.js\n\n- Remove the "node_modules/sharp" directory, run "npm install" and look for errors\n- Consult the …
Run Code Online (Sandbox Code Playgroud)

npm gatsby yarnpkg

7
推荐指数
1
解决办法
1551
查看次数

标签 统计

gatsby ×1

npm ×1

yarnpkg ×1