简体   繁体   English

糟糕! 和npm ERR! 在运行sudo npm install时

[英]gyp ERR! and npm ERR! while running sudo npm install

I am working on a web application project. 我正在从事一个Web应用程序项目。 I reinstalled my ubuntu for some problem. 我因某些问题重新安装了ubuntu。 I am using nodejs in the backend. 我在后端使用nodejs。 I deleted the node_modules folder. 我删除了node_modules文件夹。 So I run command sudo npm install and got the long error. 所以我运行命令sudo npm install并得到了很长的错误。 I have tried reinstalling npm , nodejs , node-gyp again and again but there was no exact outcome and still getting the same errors. 我试过一次又一次地重新安装npmnodejsnode-gyp nodejs ,但是没有确切的结果并且仍然遇到相同的错误。

There is a command sudo apt-get install g++ build-essential . 有一个命令sudo apt-get install g++ build-essential I did this but this g++ build-essential is already installed the latest update. 我这样做了,但是这个g++ build-essential已经安装了最新更新。

So, what could be the reason of this error I'm not getting. 因此,可能是我未收到此错误的原因。

void@void:~/Documents/github/luvmusic$ sudo npm install

> fibers@1.0.15 install /home/void/Documents/github/luvmusic/node_modules/fibers
> node build.js || nodejs build.js

gyp ERR! configure error 
gyp ERR! stack Error: EACCES: permission denied, mkdir '/home/void/Documents/github/luvmusic/node_modules/fibers/build'
gyp ERR! System Linux 4.13.0-43-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--release"
gyp ERR! cwd /home/void/Documents/github/luvmusic/node_modules/fibers
gyp ERR! node -v v8.11.2
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-gyp exited with code: 1
Please make sure you are using a supported platform and node version. If you
would like to compile fibers on this machine please make sure you have setup your
build environment--
Windows + OS X instructions here: https://github.com/nodejs/node-gyp
Ubuntu users please run: `sudo apt-get install g++ build-essential`
Alpine users please run: `sudo apk add python make g++`
sh: 1: nodejs: not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! fibers@1.0.15 install: `node build.js || nodejs build.js`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the fibers@1.0.15 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/void/.npm/_logs/2018-05-29T15_54_37_402Z-debug.log

You're using a older version of GCC for compiling your project. 您使用的是旧版GCC来编译您的项目。 If you're on Ubuntu 16.04 this might help to you 如果您使用的是Ubuntu 16.04,这可能对您有所帮助

sudo add-apt-repository ppa:jonathonf/gcc-7.1
sudo apt-get update
sudo apt-get install gcc-7 g++-7
gcc-7 --version

Don't forget to make a symbolic link to gcc-7 to gcc and g++-7 to g++ as default gcc and g++ 不要忘记将gcc-7到gcc和g ++-7到g ++的符号链接设置为默认gcc和g ++

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

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