【发布时间】:2015-07-30 20:50:11
【问题描述】:
我一整天都在尝试解决这个问题。
当我在 cmd 提示符下运行 node -v 或 npm install 时,它工作得非常好。但是当我在 Powershell 中运行相同的命令时,会出现以下错误:s
PS C:\Users\Anubhav.Trivedi> node -v
The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelli
ng of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:5
+ node <<<< -v
+ CategoryInfo : ObjectNotFound: (node:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
我尝试卸载 node js 并重新安装它。在环境变量(系统变量)中添加了节点 js 路径 C:\Program Files (x86)\nodejs\。重新启动计算机。但似乎没有任何效果。
请告诉我,我在这里缺少什么。
【问题讨论】:
-
检查该文件夹是否真的在您的路径中。如果是这样,这将返回一个值:
$env:path -split ';' | Select-String nodejs您是否记得在更新 Path 环境变量时重新启动 PowerShell 控制台? -
谢谢。它现在正在工作。
-
请输入答案并将问题标记为已回答。
标签: windows node.js powershell npm