首页 > 解决方案 > VSCode terminal can't find NodeJs

问题描述

my VSCode (Win10) terminal is having issues when running NodeJs commands, such as npm run start (reactJs) or even npm install. I'm getting an error as if NodeJs was not in the $PATH as below. However, when I open the command prompt or powershell (without admin rights) the commands run normally.

Until yesterday it was working fine. Any ideas?

16 verbose Windows_NT 10.0.19041
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "start"
18 verbose node v12.18.4
19 verbose npm  v6.14.6
20 error code ELIFECYCLE
21 error errno 1
22 error xbet-betfair@0.1.0 start: `react-scripts start`
22 error Exit status 1
23 error Failed at the xbet-betfair@0.1.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Just to clarify, the files are were they are expected to be and, again, when I run them OUTSIDE VSCode everything works fine. The above is an example, but happens when a npm install requires to run a script to do an install too. For some reason, VSCode terminal can't find node.

标签: node.jsnpmvisual-studio-code

解决方案


推荐阅读