Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Json 角度6指定的命令(“部署”)无效。有关可用选项的列表,请运行";“帮助”;_Json_Angular5_Npm Scripts_Angular6 - Fatal编程技术网

Json 角度6指定的命令(“部署”)无效。有关可用选项的列表,请运行";“帮助”;

Json 角度6指定的命令(“部署”)无效。有关可用选项的列表,请运行";“帮助”;,json,angular5,npm-scripts,angular6,Json,Angular5,Npm Scripts,Angular6,我已将Angular 5应用程序迁移到Angular 6。除了package.json中的自定义脚本外,它工作正常 当我在终端中使用ng deploy时,它显示以下错误: 指定的命令(“部署”)无效。有关可用选项的列表,请运行“ng帮助”。你是说“帮助”吗 下面是我的package.json文件 "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test",

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

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

指定的命令(“部署”)无效。有关可用选项的列表,请运行“ng帮助”。你是说“帮助”吗

下面是我的package.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

相关,您是否应该运行
npm run deploy
package.json
脚本与npm的CLI一起使用(
ng
),谢谢,@Daniel W Strimpel。工作..这很有帮助。你能解释为什么npm不运行ng或只是npm吗