简体   繁体   English

安装 npm 模块时出现 Ubuntu/巨大错误

[英]Ubuntu/ Huge Error while installing npm modules

Node: 12.6.0, Npm:6.10.1, Ubuntu: 19.04节点:12.6.0,Npm:6.10.1,Ubuntu:19.04

I got this huge error when I run npm i <package-name> Error Link https://textsaver.flap.tv/lists/2s4g当我运行npm i <package-name>错误链接https://textsaver.flap.tv/lists/2s4g时,我遇到了这个巨大的错误

When I include sudo sudo i <package-name> I got this error当我包含 sudo sudo i <package-name>出现此错误

usama@usama:~/Learn/back-end/advance-nodejs/section two$ sudo npm i webworker-threads

> webworker-threads@0.7.17 install /home/usama/Learn/back-end/advance-nodejs/section two/node_modules/webworker-threads
> node-gyp rebuild

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/usama/Learn/back-end/advance-nodejs/section two/node_modules/webworker-threads/build'
gyp ERR! System Linux 5.0.0-20-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/usama/Learn/back-end/advance-nodejs/section two/node_modules/webworker-threads
gyp ERR! node -v v12.6.0
gyp ERR! node-gyp -v v5.0.2
gyp ERR! not ok 
npm WARN section-two@1.0.0 No description
npm WARN section-two@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! webworker-threads@0.7.17 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the webworker-threads@0.7.17 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/usama/.npm/_logs/2019-07-13T15_25_15_922Z-debug.log
usama@usama:~/Learn/back-end/advance-nodejs/section two$ 

使用 yarn 而不是 npm 解决了这个问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM