node.js - ubuntu npm安装错误

标签 node.js npm npm-install

您好,我想安装一个名为 nasim-bot 的 npm 软件包,但出现错误并且找不到解决方案。

命令是:

npm install nasim-bot

错误是:

> unix-dgram@0.2.3 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:unix-dgram@0.2.3 unix-dgram@0.2.3 install: `node-gyp rebuild`
npm WARN install:unix-dgram@0.2.3 Exit status 1
npm WARN mailbot@1.0.0 No repository field.

最佳答案

问题出在我安装的node.js上。使用以下命令安装它:

sudo npm install -g n
sudo n latest

关于node.js - ubuntu npm安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41931513/

相关文章:

node.js - Mongoose - find({},cb) 和 find({}).exec(cb) 之间有什么区别?

javascript - npm python-shell 不适用于 Electron

node.js - 减少 NPM 内存使用

javascript - TypeError AWS.KinesisVideo 不是构造函数

node.js - npm UNMET PEER DEPENDENCY 错误,无法安装 Braintree

node.js - 无法使用 Visual Studio 2013 将 Node js 站点发布到 azure

java - 为什么 java socket.io 发射失败

node.js - AWS S3 使用 docker 容器解析 URI 错误

javascript - 连接 create-react-app reactJs 和 mysql

reactjs - create-react-app 自 4.0.1 版起不起作用