执行npm安装时出错

时间:2016-01-11 09:19:00

标签: node.js npm

在mac上运行sudo npm install命令时出现以下错误。我不知道如何解决这个错误。我甚至尝试升级到最新版本的Node.js和npm。错误详情:

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! v8-debug@0.4.6 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the v8-debug@0.4.6 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

错误记录来自teh /Users/praveen/app/npm-debug.log

yargs@1.3.3~install: yargs@1.3.3
1496 silly lifecycle yargs@1.3.3~install: no script for install, continuing
1497 silly install v8-debug@0.4.6 /Users/pl1/infra-     readiness/node_modules/.staging/v8-debug-c41ee7599724f5442e30f83a214022ae
1498 info lifecycle v8-debug@0.4.6~install: v8-debug@0.4.6
1499 verbose lifecycle v8-debug@0.4.6~install: unsafe-perm in lifecycle false
1500 verbose lifecycle v8-debug@0.4.6~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 v8-debug@0.4.6~install: CWD: /Users/pl1/infra-readiness/node_modules/v8-debug
1502 silly lifecycle v8-debug@0.4.6~install: Args: [ '-c', 'node-pre-gyp install --fallback-to-build' ]
1503 silly lifecycle v8-debug@0.4.6~install: Returned: code: 1  signal: null
1504 info lifecycle v8-debug@0.4.6~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 mongodb-core@1.2.31 requires a peer of kerberos@~0.0   but none was installed.
1512 verbose stack Error: v8-debug@0.4.6 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 v8-debug@0.4.6
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 v8-debug@0.4.6 install: `node-pre-gyp install --fallback-to-build`

此前工作正常。有人能让我知道这是什么问题吗?

1 个答案:

答案 0 :(得分:0)

你可以在这里尝试几件事。前两个:

1)。检查您的问题是否与this one相对应:如果是,请更新xcode和xcode工具以消除node-gyp错误。

2)。 (可选)从自制程序中卸载您的节点,而不是使用NVM(我强烈推荐这个),然后再试一次。

如果你已经尝试了这些,请报告回来,我会在答案中加入更多选项。相信上述之一将解决您的问题。

请同时使用已安装的node和npm版本更新您的问题。