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

后端 未结 18 2363
佛祖请我去吃肉
佛祖请我去吃肉 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:41

    I also encountered this issue. Did the following and it got fixed.

    1. Open your computer terminal (not VSCode terminal) and type node --version to ensure you have node installed. If not, then install node using nvm.
    2. Then head to your bash file (eg .bashrc, .bash_profile, .profile) and add the PATH:
     [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"  # This loads nvm 
     [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
    
    1. If you have multiple bash files, you ensure to add the PATH to all of them.
    2. Restart your VSCode terminal and it should be fine.

提交回复
热议问题