2016-09-09 178 views
0

我試圖安裝mmmagic但我得到以下錯誤:NPM安裝mmmagic失敗

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "mmmagic" 
npm ERR! node v4.2.6 
npm ERR! npm v3.5.2 
npm ERR! file sh 
npm ERR! code ELIFECYCLE 
npm ERR! errno ENOENT 
npm ERR! syscall spawn 

npm ERR! [email protected] install: `node-gyp rebuild` 
npm ERR! spawn ENOENT 
npm ERR! 
npm ERR! Failed at the [email protected] 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 mmmagic 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 mmmagic 
npm ERR! Or if that isn't available, you can get their info via: 
npm ERR!  npm owner ls mmmagic 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /var/www/learningbankapi/src/npm-debug.log 

我試圖運行

npm install node-gyp rebuild 

就其本身而言但是這並沒有解決問題。

誰能告訴我爲什麼會發生這種情況,以及我如何解決它?

+0

我想這可能是因爲缺少'node'符號鏈接。假設你在Ubuntu/Debian上,你應該能夠通過安裝'nodejs-legacy'軟件包來安裝符號鏈接。否則,您可以手動安裝符號鏈接,以便調用'node'指向'nodejs'。如果這沒有幫助,請發佈導致這些'npm ERR!'的控制檯輸出。線。 – mscdex

+0

這工作請張貼它作爲一個迴應觀察家 –

回答

1

問題是缺少符號鏈接node。在Debian/Ubuntu上,您可以通過安裝​​軟件包來添加符號鏈接。否則,您可以手動創建一個符號鏈接到nodejs可執行文件。