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

后端 未结 18 2276
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-07 23:54

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

相关标签:
18条回答
  • 2020-12-08 00:29

    I did which node on my terminal: /usr/local/bin/node

    and then i added "runtimeExecutable": "/usr/local/bin/node" in my json file.

    0 讨论(0)
  • 2020-12-08 00:29

    I had a similar issue with zsh and nvm on Linux, I fixed it by adding nvm initialization script in ~/.profile and restart login session like this

    export NVM_DIR="$HOME/.nvm" 
     [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm 
     [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
    
    0 讨论(0)
  • 2020-12-08 00:34

    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

    0 讨论(0)
  • 2020-12-08 00:35

    I am on OSX, this did not work for me:

    code . --user-data-dir='.'
    

    but this DID work:

    code . -data-dir='.'
    
    0 讨论(0)
  • 2020-12-08 00:37

    This is the solution according to the VS code debugging page. This worked for my setup on Windows 10.

    "version": "0.2.0",
    "configurations": [
    {
        "type": "node",
        "request": "launch",
        "name": "Launch Program",
        "program": "${file}"
    }
    

    The solution is here:

    https://code.visualstudio.com/docs/editor/debugging

    Here is the launch configuration generated for Node.js debugging

    0 讨论(0)
  • 2020-12-08 00:38

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

    0 讨论(0)
提交回复
热议问题