[英]gyp ERR! and npm ERR! while running sudo npm install
我正在從事一個Web應用程序項目。 我因某些問題重新安裝了ubuntu。 我在后端使用nodejs。 我刪除了node_modules
文件夾。 所以我運行命令sudo npm install
並得到了很長的錯誤。 我試過一次又一次地重新安裝npm
, nodejs
, node-gyp
nodejs
,但是沒有確切的結果並且仍然遇到相同的錯誤。
有一個命令sudo apt-get install g++ build-essential
。 我這樣做了,但是這個g++ build-essential
已經安裝了最新更新。
因此,可能是我未收到此錯誤的原因。
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
您使用的是舊版GCC來編譯您的項目。 如果您使用的是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
不要忘記將gcc-7到gcc和g ++-7到g ++的符號鏈接設置為默認gcc和g ++
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.