2016-01-11 220 views
0

在我的mac上運行sudo npm install命令時出現以下錯誤。我不知道如何解決這個錯誤。我甚至嘗試升級到最新版本的Node.js和npm。錯誤的詳細信息:執行npm install時出錯

Darwin 13.4.0 
npm ERR! argv "/usr/local/Cellar/node/0.10.33/bin/node" "/usr/local/bin/npm" "install" 
npm ERR! node v5.4.0 
npm ERR! npm v3.3.12 
npm ERR! code ELIFECYCLE 

npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build` 
npm ERR! Exit status 1 
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-pre-gyp install -- fallback-to-build'. 
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 v8-debug package, 
npm ERR! not with npm itself. 
npm ERR! Tell the author that this fails on your system: 
npm ERR!  node-pre-gyp install --fallback-to-build 
npm ERR! You can get their info via: 
npm ERR!  npm owner ls v8-debug 
npm ERR! There is likely additional logging output above. 

npm ERR! Please include the following file with any support request: 
npm ERR!  /Users/praveen/app/npm-debug.log 

錯誤日誌從德/Users/praveen/app/npm-debug.log

[email protected]~install: [email protected] 
1496 silly lifecycle [email protected]~install: no script for install, continuing 
1497 silly install [email protected] /Users/pl1/infra-  readiness/node_modules/.staging/v8-debug-c41ee7599724f5442e30f83a214022ae 
1498 info lifecycle [email protected]~install: [email protected] 
1499 verbose lifecycle [email protected]~install: unsafe-perm in lifecycle false 
1500 verbose lifecycle [email protected]~install: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/pl1/infra- readiness/node_modules/v8-debug/node_modules/.bin:/Users/pl1/infra- readiness/node_modules/.bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/pl 1/Documents/apache-maven-3.2.5/bin 
1501 verbose lifecycle [email protected]~install: CWD: /Users/pl1/infra-readiness/node_modules/v8-debug 
1502 silly lifecycle [email protected]~install: Args: [ '-c', 'node-pre-gyp install --fallback-to-build' ] 
1503 silly lifecycle [email protected]~install: Returned: code: 1 signal: null 
1504 info lifecycle [email protected]~install: Failed to exec install script 
1505 verbose unlock done using /Users/pl1/.npm/_locks/staging-003a86b982d419c6.lock for /Users/pl1/infra-readiness/node_modules/.staging 
1506 silly rollbackFailedOptional Starting 
1507 silly rollbackFailedOptional Finishing 
1508 silly runTopLevelLifecycles Starting 
1509 silly runTopLevelLifecycles Finishing 
1510 silly install printInstalled 
1511 warn EPEERINVALID [email protected] requires a peer of [email protected]~0.0 but none was installed. 
1512 verbose stack Error: [email protected] install: `node-pre-gyp install --fallback-to-build` 
1512 verbose stack Exit status 1 
1512 verbose stack  at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:232:16) 
1512 verbose stack  at emitTwo (events.js:87:13) 
1512 verbose stack  at EventEmitter.emit (events.js:172:7) 
1512 verbose stack  at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) 
1512 verbose stack  at emitTwo (events.js:87:13) 
1512 verbose stack  at ChildProcess.emit (events.js:172:7) 
1512 verbose stack  at maybeClose (internal/child_process.js:821:16) 
1512 verbose stack  at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5) 
1513 verbose pkgid [email protected] 
1514 verbose cwd /Users/pl1/infra-readiness 
1515 error Darwin 13.4.0 
1516 error argv "/usr/local/Cellar/node/0.10.33/bin/node" "/usr/local/bin/npm" "install" 
1517 error node v5.4.0 
1518 error npm v3.3.12 
1519 error code ELIFECYCLE 
1520 error [email protected] install: `node-pre-gyp install --fallback-to-build` 

這是較早罰款工作。有人能讓我知道什麼是問題嗎?

+0

'node -v'的輸出是什麼? – Yerken

+0

'請包括以下任何支持請求文件:/用戶/ praveen/app/npm-debug.log' – Cyrbil

+0

@Yeren節點版本是5.4.0 – zilcuanu

回答

0

有幾件事你可以在這裏嘗試。前兩個:

1)。檢查您的問題是否與this one相對應:如果是,請更新xcode和xcode工具以擺脫node-gyp錯誤。 2)。可以選擇從自制軟件中卸載節點,而是使用NVM(我強烈推薦這個),然後再試一次。

如果您已經嘗試了其中的每一項,請回報,我會在答案中加入更多選項。上面的一個很有信心可以解決你的問題。

請同時更新您的問題,並安裝node和npm版本。