npm install安装过程中的问题如何排解?

系统安装、升级讨论
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
回复
头像
九天星
帖子: 1440
注册时间: 2007-07-14 20:45

npm install安装过程中的问题如何排解?

#1

帖子 九天星 » 2018-03-03 12:40

第一次使用npm install来安装文件,安装过程中出现错误,不知道如何排解,请教!

代码: 全选

root@wlp2s0-computer:/opt/MemcacheDos# npm install

> raw-socket@1.5.2 install /opt/MemcacheDos/node_modules/raw-socket
> node-gyp rebuild

/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:354:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 4.13.0-36-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /opt/MemcacheDos/node_modules/raw-socket
gyp ERR! node -v v4.2.6
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm WARN rawsocks@1.0.0 No repository field.
npm ERR! Linux 4.13.0-36-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v4.2.6
npm ERR! npm  v3.5.2
npm ERR! code ELIFECYCLE

npm ERR! raw-socket@1.5.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the raw-socket@1.5.2 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the raw-socket package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs raw-socket
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls raw-socket
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /opt/MemcacheDos/npm-debug.log
onlylove
论坛版主
帖子: 5214
注册时间: 2007-01-14 16:23

Re: npm install安装过程中的问题如何排解?

#2

帖子 onlylove » 2018-03-03 14:02

/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127 while in binding.gyp. while trying to load binding.gyp
请确认你已经安装nodejs并且node所在的位置在$PATH变量里面
回复