2014-04-22 194 views
0

我是新來的節點。有人可以告訴我爲什麼這是失敗的?試圖理解`npm`安裝錯誤

sudo su 
nvm use 0.10 
git clone https://github.com/bitpay/insight.git && cd insight 
npm install 

...輸出省略......

> [email protected] 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 [email protected] { [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! [email protected] install: `node-gyp rebuild` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] 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

你有'node'安裝:

在我的情況相同的錯誤你從一個相當無關計算器後試圖

npm install -g Haraka 

解決的辦法是,當出現? –

+0

您是否在嘗試安裝模塊的目錄中擁有正確的權限? – mscdex

+0

不再是一個問題。我停止嘗試作爲root用戶安裝在我的虛擬機中。 – jcalfee314

回答

2

這條線:

/bin/sh的:1:節點:找不到

使我相信節點安裝不正確..在命令行中鍵入'node'會發生什麼?

+1

這個特別的錯誤是隻有當使用'sudo'時才能訪問節點。這完全可能取決於節點的安裝方式。 – mscdex

+0

'apt-get install node'確實照顧到了這個錯誤。我在回答這個問題,謝謝。不幸的是,這仍然留下了下一個錯誤:'gyp:調用'節點-e'需要('nan')''返回退出狀態1'。我更新了上面的錯誤(雖然看起來沒有其他變化)。 – jcalfee314

+0

需求'nan'錯誤可能與npm版本有關:https://github.com/bitpay/insight/issues/461 – jcalfee314

0

我運行了npm install節點(儘管它已經安裝了一定程度)並且問題已解決。

3

在命令行中,您需要有nodejs可通過節點進行訪問。

但是:在Ubuntu回購有的NodeJSAX25節點之間的混亂/衝突,後者佔據的/ usr /斌/節點的路徑。如果你從來沒有安裝節點又名AX25-節點你可以簡單地

sudo aptitude install nodejs-legacy 

這將安裝的NodeJS 創建符號鏈接到/ usr/bin中/節點。

現在npm安裝運行沒有任何錯誤消息。 nodejs vs node on ubuntu 12.04