我是节点新手。有人可以告诉我为什么会失败吗?
sudo su
nvm use 0.10
git clone https://github.com/bitpay/insight.git && cd insight
npm install
...输出省略......
> leveldown@0.10.2 install /insight/node_modules/insight-bitcore-api/node_modules/leveldown
> node-gyp rebuild
gyp: Call to 'node -e "require('nan')"' returned exit status 1. 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:431:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.11.0-19-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /insight/node_modules/insight-bitcore-api/node_modules/leveldown
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
...
npm ERR! Error: ENOENT, lstat '/insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/crypto-browserify/test/vectors/byte0002.dat'
npm ERR! If you need help, you may report this *entire* log,
npm ERR! including the npm and node versions, at:
npm ERR! <http://github.com/npm/npm/issues>
npm ERR! System Linux 3.11.0-19-generic
npm ERR! command "/root/.nvm/v0.10.26/bin/node" "/root/.nvm/v0.10.26/bin/npm" "install"
npm ERR! cwd /insight
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/crypto-browserify/test/vectors/byte0002.dat
npm ERR! fstream_path /insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/crypto-browserify/test/vectors/byte0002.dat
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack /root/.nvm/v0.10.26/lib/node_modules/npm/node_modules/fstream/lib/writer.js:284:26
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back Error: ENOTEMPTY, rmdir '/insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/timers-browserify/node_modules/process'
npm ERR! error rolling back insight-bitcore-api@0.1.9 { [Error: ENOTEMPTY, rmdir '/insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/timers-browserify/node_modules/process']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: '/insight/node_modules/insight-bitcore-api/node_modules/bitcore/node_modules/browserify/node_modules/timers-browserify/node_modules/process' }
npm ERR! leveldown@0.10.2 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the leveldown@0.10.2 install script.
npm ERR! This is most likely a problem with the leveldown 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 their info via:
npm ERR! npm owner ls leveldown
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 3.11.0-19-generic
npm ERR! command "/root/.nvm/v0.10.26/bin/node" "/root/.nvm/v0.10.26/bin/npm" "install"
npm ERR! cwd /insight
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
对此有任何见解表示赞赏!我只列出了第一个ERR块...
答案 0 :(得分:3)
这一行:
/ bin / sh:1:node:not found
让我相信节点没有正确安装..当你输入节点时会发生什么?&#39;在命令行上?
答案 1 :(得分:3)
您需要在命令行中使用 node 访问 nodejs 。
但是:在Ubuntu repos中, nodejs 和 ax25-node 之间存在混淆/冲突,后者占用/ usr / bin / node路径。当你从未安装 node 又名 ax25-node 时,你可以简单地
sudo aptitude install nodejs-legacy
这将安装nodejs 和创建指向/ usr / bin / node的符号链接。
现在npm安装运行没有任何错误消息。
在我的情况下,尝试
时出现与您相同的错误npm install -g Haraka
解决方案来自一个相当无关的stackoverflow帖子: nodejs vs node on ubuntu 12.04
答案 2 :(得分:0)
我运行了npm安装节点(即使它已经安装到某种程度)并且问题已解决。