Cannot find runtime 'node' on PATH - Visual Studio Code and Node.js

匿名 (未验证) 提交于 2019-12-03 02:20:02

问题:

With a downloaded and installed version of Visual Studio Code 1.2.1, and a 64bit version of node.exe msi placed in my working directory (I am assuming that is correct), how do we add node and npm command line tools to be on our PATH? I am confused in understanding that statement. Where and how do we implment that? I am quoting this requirement directly from the top of this resource page - https://code.visualstudio.com/Docs/runtimes/nodejs

As a result of my current situation, I set a breakpoint in an app.js file. And when I hit F5, it tells me...

Cannot find runtime 'node' on PATH  

I am completely lost in understanding and fixing this issue in Visual Studio Code.

回答1:

To follow up, I just ran into this as well. When I installed Node.js there was an option that said Add to PATH (Available After Restart). Seems like Windows just needs a restart to make things work.



回答2:

So node got kicked out of path. you can do

       SET PATH=C:\Program Files\Nodejs;%PATH% 

Or simply reinstall node to fix this. which ever you think is easiest for you



回答3:

Quick fix that works for me. Navigate to the root directory of your folder from command line (cmd). then once you are on your root directory, type:

code .  

Then, press enter. Note the ".", don't forget it. Now try to debug and see if you get the same error.



回答4:

I also ran into this error. Restart the PC works for me.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!