question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exited with code=-2 in Output window

See original GitHub issue

While running a javascript code, I keep getting following message in the output window.

[Running] node "<absolute path to file>"

[Done] exited with code=-2 in 0.005 seconds

However, when code-runner.runInTerminal is set to true, the run command works fine in terminal window.

The command run in the output window used to run fine till a day before.

I am running on the VSCode 1.12.2, node 7.10.0 on osx Sierra 10.12.4

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
bhavinkamanicommented, May 22, 2017

I found the culprit. It was "code-runner.cwd": "$workspaceRoot". I had kept it while trying to troubleshoot some other issue. Started receiving the expected result in output window once I removed this settings.

Putting this down for those who may face similar issue.

0reactions
bhavinkamanicommented, May 22, 2017

I restarted the computer. It didn’t help. I removed the vscode cache. That seems to have helped. I am not seeing this issue any more… Still not sure what was the root cause.

Thanks for all your help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The command exited with code 2 visual studio 2017
An error code (also exit code) of 2 means "File not found". You would check the path in your side, and also view...
Read more >
sed: What does exit code 2 mean? - Super User
I've encountered problems when using Posix utils (e.g. 'find') on Windows from .bat/.cmd files, because the commands output and expect *nix- ...
Read more >
CL.exe exited with code 2 in debug when a function is missing ...
I encountered an issue with CL.exe when compiling invalid C/C++. This program #include <stdio.h> static int badFunction(const char* ) { // no return...
Read more >
The command exited with code 2 visual studio 2017
While I am trying to build my windows application, I am getting following error. The command "C:\repos\CommunityLive\CL_GateApp\signing\ ...
Read more >
Error with visual studio build tools msvc while downloading ...
exit code: 1 ╰─> [18 lines of output] ... failed with exit code 2 [end of output] ... error: subprocess-exited-with-error.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found