【发布时间】:2018-08-08 08:59:30
【问题描述】:
我正在尝试使用 MsBuilds 构建我的角度解决方案。
下面是我的代码sn-p
> <Exec Command="npm install" WorkingDirectory="$(SolutionRoot)\Dev\AngularUI" />
> <Exec Command="npm install -g @angular/cli" WorkingDirectory="$(SolutionRoot)\Dev\AngularUI" />
> <Exec Command="ng build --prod" WorkingDirectory="$(SolutionRoot)\Dev\AngularUI" />
虽然npm i 命令工作正常,但我在ng build --prod 命令上收到错误'ng' is not recognized as an internal or external command。
我尝试从 cmd 运行相同的命令,并且在相同的构建帐户中也可以正常工作。
【问题讨论】:
-
嗨。你喜欢这个答案吗?
-
是的,我必须通过 Build 代理帐户在服务器上重新安装 node.js。
-
您是在 Linux 服务器还是 Windows 上部署了这个应用程序?我有类似的问题,我不得不用间接调用 ng build 的脚本替换 ng build
-
在 Windows 上部署它。从构建帐户重新安装 Node.js 为我修复了它
标签: angularjs node.js msbuild npm-install ng-build