angular 6 指定的命令("deploy")无效。有关可用选项的列表,请运行"ng help"



我已经将我的 Angular 5 应用程序迁移到了 Angular 6。除了package.json中的自定义脚本外,它工作正常。

当我在终端中使用ng deploy时,它显示以下错误:

指定的命令("部署"(无效。有关可用选项的列表,请运行"ng help"。你的意思是"帮助"吗?

下面是我的包.json 文件

"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"ngsw-config": "node_modules/.bin/ngsw-config dist src/ngsw-config.json",
"ngsw-copy": "cp node_modules/@angular/service-worker/ngsw-worker.js dist/",
"deploy": "ng build --prod && npm run ngsw-config && npm run ngsw-copy"
},

尝试使用npm run deploy.

并非 package.json 中的所有命令都与ng相关

最新更新