Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find runtime 'node' on PATH. #10876

Closed
UVk opened this issue Aug 24, 2016 · 16 comments
Closed

Cannot find runtime 'node' on PATH. #10876

UVk opened this issue Aug 24, 2016 · 16 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@UVk
Copy link

UVk commented Aug 24, 2016

  • VSCode Version: Code 1.4.0 (6276dcb, 2016-08-04T16:45:31.680Z)
  • OS Version: Windows_NT ia32 10.0.10586

Steps to Reproduce:

  1. Open VS
  2. Launch Project

Cannot debug node application. Reinstalled node and VS, added node to PATH. nothing worked.

@weinand
Copy link
Contributor

weinand commented Aug 25, 2016

@UVk could you please launch the 'integrated terminal' in VS Code and run where node in it. What does it show?

@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Aug 25, 2016
@mjbvz mjbvz added the javascript JavaScript support issues label Nov 12, 2016
@moimikey
Copy link

moimikey commented Feb 1, 2017

#14229

@wprater
Copy link
Contributor

wprater commented Feb 14, 2017

Im getting this issue now as well. and node is in the proper location. Im on the Insiders program.

⟩ which node                                                                                                                                13:08:10
/usr/local/bin/node

@weinand
Copy link
Contributor

weinand commented Feb 15, 2017

@wprater could you please launch the 'integrated terminal' in VS Code and run where node (Windows) or which node in it. What does it show?

@mnannola
Copy link

mnannola commented Mar 1, 2017

Getting this issue as well.

  1. Launch VSCode 1.10.0
  2. Click the 'Start Debugging' button on the Debug tab

Mac OSX 10.11.5
Using /bin/zsh as my default shell
Using nvm
Using /bin/zsh in my "terminal.integrated.shell.osx" User Settings.

Doing a which node in the integrated terminal results in : /Users/MNannola/.nvm/versions/node/v4.5.0/bin/node

@devmao
Copy link

devmao commented Mar 9, 2017

Same issue on Linux Ubuntu using nvm.
which node
/home/mao/.nvm/versions/node/v6.9.1/bin/node

@sebsto
Copy link

sebsto commented Mar 13, 2017

same issue with VS Code 1.10.2 on MacOS Sierra

$ which node 
/usr/local/bin/node

@weinand
Copy link
Contributor

weinand commented Mar 13, 2017

@sebsto @devmao what shell are you using?

@JamesBewley
Copy link

JamesBewley commented Mar 29, 2017

@sebsto @devmao @weinand I think the problem is that VS Code doesn't load a fresh environment (eg. run ~/.bash_profile) for each instance of VS Code. Even when you close all instances of VS Code it will use a cached environment unless you right-click->quit the application.

If you have changed the node version using a manager such as NVM you need to do either of the following:

  1. Quit VS Code completely and re-launch.
  2. Go to the integrated terminal (View->Integrated Terminal) and run the following:
    source ~/.bash_profile

I would say this is a bug as you would expect VS Code to reload the environment every time you launch a new window.

Note: I think this only applies to MacOS

@weinand weinand assigned joaomoreno and unassigned weinand Mar 29, 2017
@weinand weinand removed debug Debug viewlet, configurations, breakpoints, adapter issues javascript JavaScript support issues labels Mar 29, 2017
@joaomoreno
Copy link
Member

VS Code does the right thing. It reads the environment from .bashrc. Verify this by opening Developer Tools and running process.env from the Console.

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Mar 30, 2017
@JamesBewley
Copy link

@joaomoreno Yes is does the right thing (read .bashrc) but wrongly only does this once at startup and not for every new window?

@joaomoreno
Copy link
Member

Got it. Duplicate of #15452

@JamesBewley
Copy link

JamesBewley commented Mar 30, 2017

@joaomoreno I don't believe ticket #15452 covers this issue.

Ticket #15452 explicitly accepts the current behaviour and states "that [new] window will inherit the current process env (which is normal OS X behaviour)".

Although this is not normal behaviour; when you open a new tab on any terminal program you get a fresh environment.

@joaomoreno
Copy link
Member

Note that Code isn't a terminal program.

But sure: created an issue for this #23649

@NimaSoroush
Copy link

I am using nvm and I fixed the issue by adding

"runtimeExecutable": "/Users/x/.nvm/versions/node/v8.1.3/bin/node",

to launch.json.

to find nvm node executable path run which node

@tluanga34
Copy link

Above solution work for me.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests