2017-01-30 190 views
0

嗨我想安装一个叫做nasim-bot的npm软件包,但是我得到一个错误,找不到解决方案。npm安装错误ubuntu

该命令是:

npm install nasim-bot 

和错误是:

> [email protected] install /home/ali/Desktop/mailBot/node_modules/unix-dgram 
> 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.4.0-21-generic 
gyp ERR! command "/usr/bin/nodejs" "/usr/bin/node-gyp" "rebuild" 
gyp ERR! cwd /home/ali/Desktop/mailBot/node_modules/unix-dgram 
gyp ERR! node -v v4.2.6 
gyp ERR! node-gyp -v v3.0.3 
gyp ERR! not ok 
npm WARN install:[email protected] [email protected] install: `node-gyp rebuild` 
npm WARN install:[email protected] Exit status 1 
npm WARN [email protected] No repository field. 
+0

尝试添加删掉'node'到'nodejs' –

+0

等之后'ln -s/usr/bin/nodejs/usr/sbin/node' –

+0

tnx我的解决方案就像你的解决方案tol我。 –

回答

1

问题是从我安装了的node.js。安装用以下命令:

sudo npm install -g n 
sudo n latest 
0

运行命令

sudo apt-get install aptitude 

然后

sudo aptitude install npm 

解决我的问题