6

I am trying to build/run my .NET solution using Visual Studio 2019 and i get this error:

"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio\NodeJs\node.exe" exited with code 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

Nemanja Malocic
  • 176
  • 1
  • 2
  • 7
  • did your run this administrator permission ?https://stackoverflow.com/questions/59973785/the-term-node-is-not-recognized-as-the-name-of-a-cmdlet-function-script-file/62294967#62294967 – Asela Sampath Jul 21 '20 at 10:59
  • Are you using nexe package ? – jviudes Jul 21 '20 at 11:20
  • HI @AselaSampath yes with administrator permission it's the same. I don't have issue with Visual Studio not finding node, but rather build fails. – Nemanja Malocic Jul 22 '20 at 05:22
  • I got this error code with a TypeScript project. In my tsconfig, I had the `allowJS` option turned on. The verbose output told me Node was running out of heap memory. The error may have occurred because we have a large number of JS files or some JS files were too big as turning the option off made the error go away. – General Grievance Oct 06 '21 at 20:08

5 Answers5

6

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

Zoey Riordan [MSFT]:

Unfortunately this is caused by the fact that the nodejs process we run is 32-bit. 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. 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 Success? Error message
4096 no node.exe exited with code 134
4080 no node.exe exited with code 134
4076 no node.exe exited with code 134
4075 no node.exe exited with code 134
4074 no node.exe exited with code -1073741819
4073 no node.exe exited with code -1073741819
4072 no node.exe exited with code -1073741819
4071 yes
4070 yes
4068 yes
4064 yes
4000 yes

(I'm not sure if this depends on the project being compiled.)

Andreas Bilger
  • 929
  • 1
  • 10
  • 18
5

Sometimes the Node files inside the NodeJS folder become corrupted. Go to C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VisualStudio and delete the NodeJS folder.

Restart your app and compile your code. It should fix the problem. You can reinstall NODE

CodingMikey
  • 51
  • 1
  • 3
2

I had same issue, I spend so long time. Eventually I'v achieved solution. Basically problem was node.exe

  1. Back up NodeJs folder for any case(if this way won't work).
  2. Just remove node.exe in VS directory (C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VisualStudio\NodeJs)
  3. Navigate to ..\MSBuild\Microsoft\VisualStudio\NodeJs\win-x64 and copy node.exe from here and paste it in ..\MSBuild\Microsoft\VisualStudio\NodeJs (Where we have removed node.exe).
  4. Clean solution and build it. It should work.
Mamedov
  • 449
  • 4
  • 3
1

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."

SIGABRT seems to be an abbreviation for "signal abort". 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:

  • 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). To fix it, open launch.json and inside the "configurations" block, add the line: "console" : "integratedTerminal" (or overwrite if you have another one). 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. It should look like this: enter image description here (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.

  • 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.

Darren S
  • 516
  • 4
  • 8
0

I also just encounter this issue. It's very annoying as the error does not give you much to 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.

I have not looked in to why / how it is causing this problem, but removing popper has removed this exact error you got. (I don't require popper, so it is not a problem to remove it.)

I hope this works for you.

sfq
  • 376
  • 3
  • 4