【问题标题】:Windows 10 powershell 'node' not recognized as the name of a cmdlet, function, script file, or operable programWindows 10 powershell 'node' 未被识别为 cmdlet、函数、脚本文件或可运行程序的名称
【发布时间】:2022-02-03 03:43:09
【问题描述】:

PS C:\Users\DELL> node (OR) gcc --version (OR) g++ --version node: The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1

  • 节点
  •   + CategoryInfo          : ObjectNotFound: (node:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
我的 Windows 10 Powershell 出现问题,每当我尝试通过 VS 代码获取 (node/c++/c) 的运行代码时,我在 PowerShell 中遇到错误,我尝试重新启动我的笔记本电脑也尝试重新启动 PowerShell 和编辑的环境路径仍然我遇到同样的错误,我认为我的 Powershell 文件已损坏!请帮助我,我是 Stackoverflow 的新手和 B.Sc.IT 的学生,所以我的用于学习目的的 vs 代码编辑器也是依赖Powershell我完全卡住了! , 提前致谢!

由于发布答案禁令,我在这里写信希望它对社区有所帮助

其实我已经在windows 10上尝试了以下方法来解决这个问题~

  • 系统还原
  • Powershell 重启
  • Powershell 文件替换(使用 Program files..etc 中的其他窗口系统文件)
  • 故障排除后重启电脑
  • 环境路径改变 但没有任何工作... 但最终在 Windows 11 升级后它自动解决了我的问题

我建议您安装某些东西(应用程序、软件等) 来自官方可信网站,请勿篡改系统文件 除非必要也避免使用破解版本和多个 .NET 除非必要,否则仅在同一系统上使用框架和安装程序 1 .NET VISUAL STUDIO 的安装程序在我的情况下最新我认为是 问题...!!

【问题讨论】:

  • 在VSCode的PowerShell控制台输入$env:path会输出什么?

标签: powershell visual-studio-code


【解决方案1】:

您必须将节点添加到您的 PATH。转到系统->环境变量->系统变量。编辑“路径”变量并添加C:\Program Files\nodejs

【讨论】:

  • 我已经喜欢这个 ->C:\Program Files\nodejs 在环境变量中,但根据这篇文章,我的问题仍然不同,这是我最后的希望,我尝试过但没有成功 - > stackoverflow.com/questions/30318628
猜你喜欢
  • 2021-07-19
  • 1970-01-01
  • 1970-01-01
  • 2014-03-30
  • 2021-06-09
  • 2016-06-19
  • 1970-01-01
  • 2021-11-01
  • 2021-05-23
相关资源
最近更新 更多