nodevars.bat 未被识别为内部或外部命令

nodevars.bat is not recognized as an internal or external command

尝试在 TFS 构建服务器上构建我的项目时,我遇到了这个奇怪的 nodejs 错误。

有人能解释一下为什么我会收到这个错误吗? 在 TFS 构建期间,我的所有 Cordova Tools 项目都收到此错误。

非常感谢!

> C:\Program Files
> (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets
> (287): '"C:\Program Files (x86)\nodejs"\nodevars.bat' is not
> recognized as an internal or external command,  C:\Program Files
> (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets
> (287): operable program or batch file.  C:\Program Files
> (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets
> (287): '"C:\Program Files (x86)\nodejs"\node' is not recognized as an
> internal or external command,  C:\Program Files
> (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets
> (287): operable program or batch file.  C:\Program Files
> (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets
> (287): Error installing local npm package.

好的,我找到了解决方案。感谢 Molda,有点...... 错误的安装文件夹在环境变量中。

它指的是

C:\Program Files (x86)\nodejs

它安装在

C:\Program Files\nodejs

谢谢摩尔达!