术语“节点”不被识别…在PowerShell中
我一直在试图解决这个问题一整天。
当我在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
我试图卸载节点js并重新安装它。 添加节点jspathC:\Program Files (x86)\nodejs\
来环境variables(系统variables)。 重新启动计算机。 但似乎没有任何工作。 请让我知道,我在这里错过了什么。
正如dan-gph提到的,使用脚本$env:path -split ';' | Select-String nodejs
检查环境variables中的Path
$env:path -split ';' | Select-String nodejs
$env:path -split ';' | Select-String nodejs
$env:path -split ';' | Select-String nodejs
,一旦你更新环境variables中的Path
,请确保重新启动powershell
,并重新启动explorer.exe
。 这将解决这个问题。
如果仍然遇到问题,请检查您安装的是哪个nodej(32位或64位)。 只安装32位,因为PowerShell或CMD是32位程序