node.js - Node 以错误退出状态结束 3221225786

标签 node.js npm

大家好!

package.json 上,我在 scripts 下有一行上面写着"serve": "node index -test" 。如果我运行node index -test直接在 Node 命令提示符中,不会发生错误。如果我运行npm run serve ,它应该做同样的事情,当我使用 Ctrl+C 停止进程时会发生错误。这是日志:

0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\SOUSA\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'serve' ]
2 info using npm@6.0.1
3 info using node@v10.1.0
4 verbose run-script [ 'preserve', 'serve', 'postserve' ]
5 info lifecycle alloy-server@3.0.0~preserve: alloy-server@3.0.0
6 info lifecycle alloy-server@3.0.0~serve: alloy-server@3.0.0
7 verbose lifecycle alloy-server@3.0.0~serve: unsafe-perm in lifecycle true
8 verbose lifecycle alloy-server@3.0.0~serve: PATH: C:\Users\SOUSA\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Alloy_Server_v3\node_modules\.bin;C:\Users\SOUSA\AppData\Roaming\npm;C:\Program Files\nodejs\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\ImageMagick-6.9.3-Q16;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\ImageMagick-6.9.1-Q16;C:\Program Files\ImageMagick-6.9.0-Q16;C:\Program Files (x86)\Common Files\Intel\Shared Files\cpp\bin\Intel64;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\git\cmd;C:\Program Files (x86)\Windows Live\Shared;C:\ProgramData\chocolatey\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;C:\Program Files\nodejs\;C:\Users\SOUSA\.cargo\bin;C:\NVPACK\gradle-2.9\bin;C:\NVPACK\jdk1.8.0_77\bin;C:\Users\SOUSA\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\SOUSA\AppData\Local\Microsoft\WindowsApps;C:\Users\SOUSA\AppData\Roaming\npm
9 verbose lifecycle alloy-server@3.0.0~serve: CWD: C:\Alloy_Server_v3
10 silly lifecycle alloy-server@3.0.0~serve: Args: [ '/d /s /c', 'node index -test' ]
11 silly lifecycle alloy-server@3.0.0~serve: Returned: code: 3221225786  signal: null
12 info lifecycle alloy-server@3.0.0~serve: Failed to exec serve script
13 verbose stack Error: alloy-server@3.0.0 serve: `node index -test`
13 verbose stack Exit status 3221225786
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\SOUSA\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:283:16)
13 verbose stack     at EventEmitter.emit (events.js:182:13)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\SOUSA\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:182:13)
13 verbose stack     at maybeClose (internal/child_process.js:957:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:246:5)
14 verbose pkgid alloy-server@3.0.0
15 verbose cwd C:\Alloy_Server_v3
16 verbose Windows_NT 10.0.16299
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\SOUSA\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "serve"
18 verbose node v10.1.0
19 verbose npm  v6.0.1
20 error code ELIFECYCLE
21 error errno 3221225786
22 error alloy-server@3.0.0 serve: `node index -test`
22 error Exit status 3221225786
23 error Failed at the alloy-server@3.0.0 serve script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3221225786, true ]

我尝试过但无济于事:

  1. This answer
  2. 以管理员身份运行 Node 命令提示符
  3. 创建一个新文件夹,将源文件复制到其中并运行 npm install

我一直在寻找有关此退出状态3221225786的更多信息,但三个小时后我仍然无法解决问题。非常感谢任何帮助。

编辑:当我使用 VS Code 控制台时,该错误也不会发生。它仅在 Node.js 命令提示符下发生。

最佳答案

万一有人偶然发现同样的错误,当我更新到 Node 10.2.0 和 NPM 6.0.1 时,问题就消失了。所以我想更新或者全新安装可以解决这个问题。

关于node.js - Node 以错误退出状态结束 3221225786,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50371048/

相关文章:

node.js - travis 成功运行后,语义发布不会发布

node.js - 需要使用 Node.js 压缩整个目录

ajax - 如何通过 HTTPS 向 node.js 服务器发送 AJAX 请求?

node.js - Truffle 安装后启动失败

ionic-framework - 如何修复 'Unsupported platform for fsevents@1.2.9: wanted {"操作系统“:"darwin","arch":"any"}(当前 : {"os" :"win32" ,"arch" :"x64"})

javascript - "A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received",这是什么意思?

node.js - 无法在 Node 12.7 中安装 LDAP

node.js - 更新具有数组和对象键的嵌套对象是动态的

javascript - MongoDB/EJS : How to make synchronous query and render result values in EJS

javascript - 什么是 javascript monorepo 的正确方法