gpt4 book ai didi

node.js - 由于 node-api@ELIFECYCLE,npm 启动失败

转载 作者:搜寻专家 更新时间:2023-11-01 00:09:55 27 4
gpt4 key购买 nike

我在启动 node.js 服务器时遇到问题。服务器应用程序在另一个系统上进行了测试并且运行良好。错误日志显示 node-api@ 有问题,但我找不到任何解决方案。

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node', '/usr/local/bin/npm', 'start' ]
2 info using npm@2.9.1
3 info using node@v0.12.3
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info prestart node-api@
6 info start node-api@
7 verbose unsafe-perm in lifecycle true
8 info node-api@ Failed to exec start script
9 verbose stack Error: node-api@ start: `node server.js`
9 verbose stack Exit status 1
9 verbose stack at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:213:16)
9 verbose stack at EventEmitter.emit (events.js:110:17)
9 verbose stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
9 verbose stack at ChildProcess.emit (events.js:110:17)
9 verbose stack at maybeClose (child_process.js:1015:16)
9 verbose stack at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
10 verbose pkgid node-api@
11 verbose cwd /Volumes/HDD/Users/…/app/db
12 error Darwin 14.3.0
13 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
14 error node v0.12.3
15 error npm v2.9.1
16 error code ELIFECYCLE
17 error node-api@ start: `node server.js`
17 error Exit status 1
18 error Failed at the node-api@ start script 'node server.js'.
18 error This is most likely a problem with the node-api package,
18 error not with npm itself.
18 error Tell the author that this fails on your system:
18 error node server.js
18 error You can get their info via:
18 error npm owner ls node-api
18 error There is likely additional logging output above.
19 verbose exit [ 1, true ]

我的安装有什么问题,我该如何解决?

最佳答案

您可以在这里尝试两件事:

  1. 确保您运行的 Node 版本与其他运行良好的系统相同。您可以通过在您的终端和它正在运行的终端上输入以下内容来测试它:node -v。如果它们不同,请升级(或降级)您的安装。
  2. 从当前计算机的项目根目录中删除 node_modules 目录,然后运行 ​​npm install 以确保编译的二进制文件与您的操作系统兼容。

关于node.js - 由于 node-api@ELIFECYCLE,npm 启动失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30239752/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com