“npm ERR!errno 3221225477”使用 oracledb 进行查询时节点出错

Posted

技术标签:

【中文标题】“npm ERR!errno 3221225477”使用 oracledb 进行查询时节点出错【英文标题】:"npm ERR! errno 3221225477" Error in Node when making a query using oracledb 【发布时间】:2020-03-04 11:15:23 【问题描述】:

这是命令行中的错误本身:

npm ERR! code ELIFECYCLE
npm ERR! errno 3221225477
npm ERR! versioncenter@0.0.1 start: `node ./bin/www`
npm ERR! Exit status 3221225477
npm ERR!
npm ERR! Failed at the versioncenter@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\USERNAME\AppData\Roaming\npm-cache\_logs\2019-11-13T17_17_52_250Z-debug.log
/c/Program Files/nodejs/npm: line 37:  1341 Segmentation fault      "$NODE_EXE" "$NPM_CLI_JS" "$@"

这是错误日志:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'start'
1 verbose cli ]
2 info using npm@6.11.3
3 info using node@v12.11.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle versioncenter@0.0.1~prestart: versioncenter@0.0.1
6 info lifecycle versioncenter@0.0.1~start: versioncenter@0.0.1
7 verbose lifecycle versioncenter@0.0.1~start: unsafe-perm in lifecycle true
8 verbose lifecycle versioncenter@0.0.1~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\version_center\node_modules\.bin;C:\Users\USERNAME\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\USERNAME\bin;C:\Python27;C:\Python27\Scripts;C:\app\client\USERNAME\product\12.2.0\client_1;C:\app\client\USERNAME\product\12.2.0\client_1\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\PuTTY;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Users\USERNAME\AppData\Local\Microsoft\WindowsApps;C:\Users\USERNAME\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\USERNAME\AppData\Local\Programs\Fiddler;C:\Users\USERNAME\AppData\Roaming\npm;C:\app\instantclient_19_3;C:\Program Files\nodejs\node.exe;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle versioncenter@0.0.1~start: CWD: C:\version_center
10 silly lifecycle versioncenter@0.0.1~start: Args: [ '/d /s /c', 'node ./bin/www' ]
11 silly lifecycle versioncenter@0.0.1~start: Returned: code: 3221225477  signal: null
12 info lifecycle versioncenter@0.0.1~start: Failed to exec start script
13 verbose stack Error: versioncenter@0.0.1 start: `node ./bin/www`
13 verbose stack Exit status 3221225477
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:210:5)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:210:5)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid versioncenter@0.0.1
15 verbose cwd C:\version_center
16 verbose Windows_NT 10.0.17134
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start"
18 verbose node v12.11.1
19 verbose npm  v6.11.3
20 error code ELIFECYCLE
21 error errno 3221225477
22 error versioncenter@0.0.1 start: `node ./bin/www`
22 error Exit status 3221225477
23 error Failed at the versioncenter@0.0.1 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 3221225477, true ]

脚本:

“脚本”: "watch": "pm2 日志", "start": "pm2 start ./bin/www --watch --ignore-watch='node_modules' --max-memory-restart 100M & npm run watch", "startDev": "pm2 启动 ./bin/www", "停止": "pm2 停止 0"

此错误非常间歇性。

我试过清理缓存,删除node_modules,package-lock.json,重新安装。

我已完全禁用所有防病毒软件和防火墙,包括我在 3 个不同网络上测试过的网络防火墙。

对正在发生的事情有什么想法吗?

【问题讨论】:

可能是您的杀毒软件或防火墙在窃听 npm:***.com/questions/45245920/elifecycle-npm-error 我在没有防病毒软件或防火墙的情况下进行了测试,但仍然间歇性地出现错误。 我们真的需要更多信息。请您分享与处理查询的路线相关的代码。这是和快递应用吗? 这是一个 Express 应用程序,是的。您是指路由 js 文件还是执行查询的实际整个函数?通过使用 pm2 让它继续运行,我能够让应用程序在 prod 中运行,但如果可能的话,我肯定想解决这个错误。 查看您的 Express 应用程序的日志。有注意事项有用。 【参考方案1】:

如果您运行npm cache clean --force,您将清除您的 npm 缓存。这可能会删除缓存中可能导致此问题的任何内容。如果您仍然有问题,我建议您重新安装 npm/node.js,如果有任何与 npm/node.js 相关的问题,它应该会清除。它也可能与防火墙有关,尽管 OP 表示它与防火墙有关。。仔细检查您的防火墙以防万一。

我找到了 here 的东西,这是我找到 npm cache clean --force 解决方案的地方。

我希望这会有所帮助。我是这个论坛的新成员,所以请不要因为我对这种情况的可怕解释而责备我。我只需要一些声誉和实践,而不是更多的气馁。

【讨论】:

我在我的问题中提到我已经清除了缓存,并且我还在一个全新的系统上进行了同样问题的测试。我在没有防火墙或防病毒软件的系统上进行了测试,完全禁用并卸载了。 旧的 nodejs node-oracledb 库? Oracle 客户端库(二进制)可以吗? @LeviBlodgett 我不知道你已经清除了缓存。帖子的那一部分要么不在你的帖子中,要么我只是跳过了那个特定的句子。也许尝试安装较旧或较新版本的 npm 或 node.js。发生在我身上的是 Windows(如@MI53RE 所述)无法访问文件夹或文件。顺便问一下,那个名为“versioncenter”的 npm 模块是干什么用的? 我不需要强制清理缓存,npm cache verify 对我来说已经足够了。【参考方案2】:

据我所知,这似乎是与 Windows 访问冲突相关的错误:

https://github.com/nodejs/node/blob/842e5a10ac59c826f875ef79e92d144e2655cc9a/test/common.js#L502-L505

  // On Windows, v8's base::OS::Abort triggers an access violation,
  // which corresponds to exit code 3221225477 (0xC0000005)
  if (process.platform === 'win32')
    expectedExitCodes = [3221225477];

[编辑:] 最终尝试将 (node@v12.11.1 --> node@v12.13.1) 升级到 node 的最新 LTS 版本,因为它可能会解决您的问题

【讨论】:

我运行它的三个系统之一是版本 13.1.0,新安装,所以不是这样。我正在尝试查看您目前在 node.js 代码中发现的内容。 从 12.0.0 迁移到 12.22.5 后在 Windows 中为我工作【参考方案3】:

对于将来偶然发现这个问题的任何人,这就是我“修复”它的方式:

我使用PM2 包装应用程序并在它崩溃时自动重启,它不会停止崩溃但它会在与用户保持连接的同时重新加载,这样他们就不会注意到。

它很乱,但我从来没有找到这个错误的原因或如何解决它。

【讨论】:

哇。我也对此表示反对。我正在使用 pm2 和不使用 pm2 启动节点,但无论如何,如果我在启动时启动它,我会遇到这个问题。我想不出解决方案,我也在使用 pm2-windows-service 并以用户身份运行该服务。如果我弄清楚了,我会在这里写下来。 如果您使用某种工作调度程序,这不是一个选项【参考方案4】:

尝试再次安装 node.js 它对我有用 如果安装节点不起作用,请安装所有依赖项

【讨论】:

请尝试在您的建议中添加一些分步说明和/或代码驱动范例。

以上是关于“npm ERR!errno 3221225477”使用 oracledb 进行查询时节点出错的主要内容,如果未能解决你的问题,请参考以下文章