node.js之NPM/Nodejs : Can't install scrypt@6. 0.3
jillzhang
阅读:53
2024-02-13 20:32:18
评论:0
实际上我正在尝试安装 express-basic-auth
,但由于安装scrypt@6.0.3
而失败.我已经尝试过:
sudo apt-get install build-essential
并尝试删除
~/.node-gyp
如此处所述:
https://github.com/nodejs/node-gyp/issues/809 ,但没有任何建议有帮助。我仍然得到同样的错误:
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/user/code/a/b/node_modules/scrypt/build'
gyp ERR! System Linux 4.20.0-042000-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/user/code/a/b/node_modules/scrypt
gyp ERR! node -v v9.11.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN b@1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! scrypt@6.0.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the scrypt@6.0.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/user/.npm/_logs/2018-12-30T20_52_24_060Z-debug.log
有人可以帮忙吗?
请您参考如下方法:
我通过在本地安装早期版本的 Node 解决了这个问题,在我的例子中是 Node 8.10.0 版本。我不再遇到您在这里遇到的相同错误。删除你的 Node 模块和 package-lock.json 然后运行
npm install --save node@earlierversion
npm install rest of packages
这就是我重建 Node 模块并防止此错误的方法。
声明
1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。