node.js - 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.
解决方案
推荐阅读
- javascript - 使用 React 和 Redux 处理数据密集型请求的最佳方式是什么?
- html - 为什么我按箭头键时黑匣子不动?
- ios - 尝试在 iOS 的 txt 文件中保存数据时出现 UI 阻塞
- python - 解码 berkeley db 字符串
- python - 无法使用相对导入从当前目录导入 urllib3
- vue.js - Vuex:使用模块化的 Mutations 和 vuex 的 createNamespacedHelpers API
- python - 在 Python 中连接浮点值数组
- c# - 在 dotnet 命令上限制内存
- azure-devops - 使用 REST API 编辑 Release 定义或 Build 定义以传递变量组或 Schedule 是一个好方法
- css - CSS Mask 仅在 X 和 Y 轴上按时重复