Angular NPM 运行 产品:错误 npm ERR!缺少脚本:产品
Angular NPM Run Prod: Error npm ERR! missing script: prod
我 运行 npm 有一个新的 Angular 项目并收到以下错误。如何解决这个问题?
npm ERR! missing script: prod
npm ERR! A complete log of this run can be found in:
npm ERR! C:\..2020-11-19T05_27_19_941Z-debug.log
这是因为您的 package.json 文件中没有脚本 : prod
。如果你想运行 angular项目,你可以使用ng serve
或npm run start
这意味着您的脚本中没有 prod
的配置。基本上,对于 运行 任何 angular 项目,您需要确保脚本或命令在您的 package.json
中定义。大多数 angular 项目的脚本配置如下
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
因此,您可以在命令中 运行 ng serve
或 npm start
来启动应用程序。
我 运行 npm 有一个新的 Angular 项目并收到以下错误。如何解决这个问题?
npm ERR! missing script: prod
npm ERR! A complete log of this run can be found in:
npm ERR! C:\..2020-11-19T05_27_19_941Z-debug.log
这是因为您的 package.json 文件中没有脚本 : prod
。如果你想运行 angular项目,你可以使用ng serve
或npm run start
这意味着您的脚本中没有 prod
的配置。基本上,对于 运行 任何 angular 项目,您需要确保脚本或命令在您的 package.json
中定义。大多数 angular 项目的脚本配置如下
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
因此,您可以在命令中 运行 ng serve
或 npm start
来启动应用程序。