`npm run build:prod:aot`在ng2-admin中缺less脚本
我通过这个命令创buildng2-admin应用图像npm run build:prod
它成功创build图像,但是当我在docker上部署这个图像时,它一直给我错误,所以我想运行
npm run build:prod:aot
这个命令通过提前检查错误编译这个给我的脚本是缺less的错误
这里是我运行npm run build:prod:aot
命令的错误日志
0 info it worked if it ends with ok 1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe', 1 verbose cli 'C:\\Users\\ali\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'build:prod:aot' ] 2 info using npm@5.5.1 3 info using node@v6.10.0 4 verbose stack Error: missing script: build:prod:aot 4 verbose stack at run (C:\Users\ali\AppData\Roaming\npm\node_modules\npm\lib\run-script.js:151:19) 4 verbose stack at C:\Users\ali\AppData\Roaming\npm\node_modules\npm\lib\run-script.js:61:5 4 verbose stack at C:\Users\ali\AppData\Roaming\npm\node_modules\npm\node_modules\read-package-
这个项目在当地完美无瑕
假设你指的是https://github.com/akveo/ngx-admin ,你的命令将不起作用,因为package.json中没有这样的脚本。
package.json文件必须包含“build:prod:aot”脚本,以便能够使用npm运行它。
例如; 上面的项目的package.json看起来像这样:
... "scripts": { ... "ng": "ng", "conventional-changelog": "conventional-changelog", "start": "ng serve", "build": "ng build", "build:prod": "npm run build -- --prod --aot", ... }, ...
您将需要添加一行与您想要通过添加执行的脚本
"build:prod:aot": " /* script */"
将其添加到package.json后,您将能够使用npm run build:prod:aot
来运行脚本。
附注:它看起来像npm run build:prod
已经使用AOT这个特定的项目。
- Gitlab runner:可以运行一个依赖于另一个的docker镜像
- 使用NginX在服务器上部署Angular2应用程序时,不会加载子组件
- 在Docker上运行angular2 springboot应用程序,它显示索引页面,但没有加载angular度
- Angular-CLI代理不能在Docker中工作
- angular 5 nginx Docker expressconfiguration不加载mongoose数据
- 运行干净的validation-Denv = dev错误
- 节点ArrayLiteralExpression未通过testing“isTypeNode”
- 用于angular-cli应用程序的Dockerfile返回ng:command not found
- Angular 2应用程序部署在AWS上运行的Docker容器中