简体   繁体   English

node.exe 以代码 134 Visual Studio 退出

[英]node.exe exited with code 134 Visual Studio

I am trying to build/run my .NET solution using Visual Studio 2019 and i get this error:我正在尝试使用 Visual Studio 2019 构建/运行我的 .NET 解决方案,但出现此错误:

“C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\NodeJs\node.exe”退出,代码为 134。WebTranslations C:\Program Files (x86)\Microsoft SDKs\TypeScript\ 3.8\build\Microsoft.TypeScript.targets 551

I think this has something to do with memory, because if i restart my pc i can build few times, but then i start getting same error I tried playing with node_options max-old-space-size but no luck我认为这与 memory 有关,因为如果我重新启动我的电脑,我可以构建几次,但是我开始遇到同样的错误,我尝试使用 node_options max-old-space-size 但没有运气

From https://developercommunity.visualstudio.com/t/node-options-env-var-causes-vs-2017-to-crash/241366#T-N368702-N368874-N368902来自https://developercommunity.visualstudio.com/t/node-options-env-var-causes-vs-2017-to-crash/241366#T-N368702-N368874-N368902

Zoey Riordan [MSFT]: Zoey Riordan [MSFT]:

Unfortunately this is caused by the fact that the nodejs process we run is 32-bit.不幸的是,这是因为我们运行的 nodejs 进程是 32 位的。 In 32-bit node you cannot set max_old_space_size above 4095 since 32-bit process are not able to allocate a full 4GB of heap space.在 32 位节点中,您不能将max_old_space_size设置为4095以上,因为 32 位进程无法分配完整的 4GB 堆空间。 In order to make this work you can choose a smaller heap size or only set the flag on applications which need that amount of heap.为了完成这项工作,您可以选择较小的堆大小或仅在需要该堆大小的应用程序上设置标志。

I tried with different values below 4096 for max_old_space_size and found values that removed this build error:我为max_old_space_size尝试了低于4096的不同值,并找到了删除此构建错误的值:

max-old-space-size Success?成功? Error message错误信息
4096 4096 no node.exe exited with code 134
4080 4080 no node.exe exited with code 134
4076 4076 no node.exe exited with code 134
4075 4075 no node.exe exited with code 134
4074 4074 no node.exe exited with code -1073741819
4073 4073 no node.exe exited with code -1073741819
4072 4072 no node.exe exited with code -1073741819
4071 4071 yes是的
4070 4070 yes是的
4068 4068 yes是的
4064 4064 yes是的
4000 4000 yes是的

(I'm not sure if this depends on the project being compiled.) (我不确定这是否取决于正在编译的项目。)

I also just encounter this issue.我也刚好遇到这个问题。 It's very annoying as the error does not give you much to go on.这很烦人,因为这个错误并没有给你太多 go on。 I don't have much information about your setup.我没有太多关于你的设置的信息。 However I fixed this issue by removing the Popper.Js 1.16.1 from my installed NuGet packages.但是我通过从我安装的 NuGet 包中删除 Popper.Js 1.16.1 解决了这个问题。

I have not looked in to why / how it is causing this problem, but removing popper has removed this exact error you got.我还没有研究为什么/如何导致这个问题,但是删除 popper 已经消除了你得到的这个确切的错误。 (I don't require popper, so it is not a problem to remove it.) (我不需要popper,所以删除它不是问题。)

I hope this works for you.我希望这对你有用。

According to https://nodejs.org/api/process.html : ">128 Signal Exits: If Node.js receives a fatal signal such as SIGKILL or SIGHUP, then its exit code will be 128 plus the value of the signal code. [...] For example, signal SIGABRT has value 6, so the expected exit code will be 128 + 6, or 134." According to https://nodejs.org/api/process.html : ">128 Signal Exits: If Node.js receives a fatal signal such as SIGKILL or SIGHUP, then its exit code will be 128 plus the value of the signal code. [ ...] 例如,信号 SIGABRT 的值为 6,因此预期的退出代码将为 128 + 6 或 134。”

SIGABRT seems to be an abbreviation for "signal abort". SIGABRT 似乎是“信号中止”的缩写。 It seems to be thrown whenever there is something that is fundamentally interfering with running the code, and most of the cases I could find online were related to modules or some kind of configuration error.每当有东西从根本上干扰代码运行时,它似乎就会被抛出,而且我可以在网上找到的大多数情况都与模块或某种配置错误有关。

In the case of modules, first make sure you have the right version installed and that they are installed in the correct working directory.对于模块,首先确保您安装了正确的版本,并且它们安装在正确的工作目录中。 The following examples aren't from Visual Studio, but they related settings there and might help with thinking through where the bug may reside, and if anyone else comes here with the same bug but for VS Code, then these are the direct solutions:以下示例不是来自 Visual Studio,但它们与那里的设置相关,并且可能有助于思考错误可能存在的位置,如果其他人来到这里有相同的错误但对于 VS Code,那么这些是直接的解决方案:

  • Some modules that enable/require input via the terminal (like 'readline-sync') don't seem to like the default "debug console" launched when using the F5 key (in VS Code).某些启用/需要通过终端输入的模块(例如“readline-sync”)似乎不喜欢使用 F5 键(在 VS Code 中)时启动的默认“调试控制台”。 To fix it, open launch.json and inside the "configurations" block, add the line: "console": "integratedTerminal" (or overwrite if you have another one).要修复它,打开 launch.json 并在“配置”块内,添加行: "console": "integratedTerminal" (或者如果你有另一个,则覆盖)。 If you don't have a launch.json, CTRL + SHIFT + P > Debug: Open launch.json > Node.js (preview) and it should generate one for you.如果您没有 launch.json, CTRL + SHIFT + P > Debug: Open launch.json > Node.js(预览版),它应该为您生成一个。 It should look like this:它应该如下所示: 在此处输入图像描述 (Also, make sure "program" is "${file}" if you want to run the currently open file.) For VS Code I imagine it's a completely different process but there might be some similarities. (另外,如果要运行当前打开的文件,请确保“程序”是“${file}”。)对于 VS Code,我想这是一个完全不同的过程,但可能有一些相似之处。

  • In another person's case, a mismatch between the saved npm engine and the node engine existed between the package.json and what was actually installed on the machine: https://stackoverflow.com/a/56135994/11533327 That might be another configuration setting somewhere to look for. In another person's case, a mismatch between the saved npm engine and the node engine existed between the package.json and what was actually installed on the machine: https://stackoverflow.com/a/56135994/11533327 That might be another configuration setting某处寻找。

Sometimes the Node files inside the NodeJS folder become corrupted.有时 NodeJS 文件夹中的 Node 文件会损坏。 Go to C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio and delete the NodeJS folder. Go 到 C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio 并删除 NodeJS 文件夹。

Restart your app and compile your code.重新启动您的应用程序并编译您的代码。 It should fix the problem.它应该可以解决问题。 You can reinstall NODE你可以重新安装NODE

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM