相关疑难解决方法(0)

安装 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
查看次数

当我运行“gatsbydevelopment”时,安装“sharp”模块出现错误,显示错误

\n

gatsby 公开开发成功并验证 gatsby-configs - 0.005 s\n 错误安装“sharp”模块出现问题模块\n \'\\?\\D:\\korero\\node_modules\\sharp\\build\ \Release\\sharp.node\' 是使用 NODE_MODULE_VERSION\n 针对不同的 Node.js 版本编译的\n 64。此版本的 Node.js 需要 NODE_MODULE_VERSION 79。请尝试重新编译或重新安装该模块(例如、使用npm\n rebuildnpm install)。\n - 确保安装时使用的 Node.js 版本与运行时使用的版本相匹配\n - 请参阅安装文档:https://sharp.pixelplumbing.com/en/stable/install/ \n - 在https://github.com/lovell/sharp/issues \xe2\xa0\x8b 加载插件中搜索此错误

\n
\n

gatsby

6
推荐指数
1
解决办法
3861
查看次数

无法安装夏普

运行时sudo npm i sharp --save出现以下错误:

> sharp@0.21.3 install /home/server/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached /home/ronny/.npm/_libvips/libvips-8.7.0-linux-x64.tar.gz
ERR! sharp EACCES: permission denied, mkdir '/home/server/node_modules/sharp/vendor'
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies
gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/server/node_modules/sharp/build'
gyp ERR! System Linux …
Run Code Online (Sandbox Code Playgroud)

node.js npm sharp

2
推荐指数
6
解决办法
1876
查看次数

标签 统计

gatsby ×2

npm ×2

node.js ×1

sharp ×1

yarnpkg ×1