简体   繁体   English

未找到 Jenkins ng 命令

[英]Jenkins ng command not found

Below are the Nodejs and Angular CLI version which are running in my windows 10 machine.下面是在我的 windows 10 机器上运行的 Nodejs 和 Angular CLI 版本。

Angular CLI: 8.3.5 Node: 10.16.3 OS: win32 x64 Angular: 8.2.7 Angular CLI:8.3.5 节点:10.16.3 操作系统:win32 x64 Angular:8.2.7

I have created jenkins job to build Angular Application in my localhost.我已经创建了 jenkins 作业来在我的本地主机中构建 Angular 应用程序。

Question is here, When i running jenkins job (Freestyle) based project, using this command "C:\Angular>npm install --save-dev @angular/cli@latest && ng v" first install command is working perfectly without any issue, but when its moving to next command "ng v" its throughout the error as like below:问题就在这里,当我运行基于 jenkins 作业(自由式)的项目时,使用此命令“C:\Angular>npm install --save-dev @angular/cli@latest && ng v”第一个安装命令运行良好,没有任何问题,但是当它移动到下一个命令“ng v”时,整个错误如下所示:

'ng' is not recognized as an internal or external command, operable program or batch file. 'ng' 不是内部或外部命令、可运行程序或批处理文件。 Build step 'Execute Windows batch command' marked build as failure Finished: FAILURE构建步骤“执行 Windows 批处理命令”将构建标记为失败已完成:失败

Note: But same cmd "npm install --save-dev @angular/cli@latest && ng v" is working as we expected in powershell.注意:但同样的 cmd "npm install --save-dev @angular/cli@latest && ng v" 在 powershell 中正常工作。

Can you please some help on this.你能帮忙吗?

npm command is recognized by default, but "ng" don't, so that you have to write "npm run" before ng command: npm 命令默认被识别,但是“ng”不识别,所以你必须在ng命令之前写“npm run”:

npm run ng .....

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM