簡體   English   中英

`npm install npm`給出gyp ERR和npm ERR

[英]`npm install npm` gives gyp ERR and npm ERR

為什么在執行sudo npm install npm時出現此奇怪的錯誤? 在嘗試安裝其他模塊時,有時也會得到它!

錯誤:

> scrypt@6.0.3 preinstall /home/user/code/project/api_v0.8/node_modules/scrypt
> node node-scrypt-preinstall.js


> scrypt@6.0.3 install /home/user/code/project/api_v0.8/node_modules/scrypt
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/user/code/project/api_v0.8/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/project/api_v0.8/node_modules/scrypt
gyp ERR! node -v v9.11.2
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN api_v0.8@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.

全新安裝軟件包怎么辦?

要解決此問題,請安裝節點版本管理器:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

用戶節點v8.15.0:

nvm install 8.15.0
nvm use 8.15.0

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM