我有一个Angular应用程序,我正试图通过Jenkins部署它。标准的DEV构建运行良好,但当我执行ng build --prod时,它显示"ng: command not fine“。
当使用npm run ng build -- --prod运行命令时,它会显示"line 1: 6910 Killed“,后跟失败的命令
上周,我可以让prod build成功完成,但没有拿起environment.prod.ts文件。今天,我得到了上面两个错误中的一个。
我尝试了以下构建命令:
sh "ng build --prod"
sh "npm run ng
我试图在GCP上使用‘’构建具有以下Dockerfile的Angular应用程序,但错误代码失败了
### STAGE 1: Build ###
# We label our stage as ‘builder’
FROM node:8.1.4-alpine as builder
COPY package.json ./
## Storing node modules on a separate layer will prevent unnecessary npm installs at each build.
# RUN npm cache clean
RUN npm i &
我已经安装了Angular 8,当我在GitHub Actions中构建我的应用程序时,我得到了下一个错误。 ERROR in main-es2015.e1115c7c82627ce27910.js from Terser
TypeError: Cannot read property 'variables' of undefined
at /app/node_modules/terser-webpack-plugin/node_modules/terser/dist/bundle.min.js:1:209686
at /app/node_modules/te
我在package.json中使用以下版本:"^17.1.50","typescript":"^2.9.2","@angular/cli":"^6.0.0-rc.5", 在没有prod tag ng build的情况下构建项目时,似乎是成功的。 但是,当我尝试优化和运行ng build --prod时,它抛出了错误 ./node_modules/@syncfusion/ej2-angular-buttons/@syncfusion/ej2-angular-buttons.es5.js模块构建失败时出错:错误:调试
ng build --prod和ng build --env=prod有什么区别?
我的理解是
ng build --env=prod只在environment.prod.ts中设置环境设置,而
ng build --prod运行--env=prod,并执行--env=prod、包、小型化、死代码消除
这是正确的吗?
由于某种原因,我不得不使用angular-builders来定制webpack。
当我将webpack版本更新为^5.11.0时,我尝试使用terser-webpack-plugin来压缩代码。
有一些错误抛出,但我不知道如何通过文档修复it.because i配置。
npm run build错误:
0% compiling
An error occurred during the build:
TypeError: The 'compilation' argument must be an instance of Compilation
at Function.ge
我正在使用angular11,在从我的项目中删除引导之后,当运行命令ng build时,它会产生以下错误,它运行良好。我试图更新核心和简洁的神职人员,但没有运气。请帮帮忙。
Error: scripts.d4d60eb3a58ff1e99223.js from Terser
意想不到的字符@ '@‘scripts.d4d60eb3a58ff1e99223.js:3,0 at js_error (D:\Projects\PorticoWebApp\node_modules\terser\dist\bundle.min.js:686:9) at parse_error (D:\Projec
子编译错误失败:模块构建失败: TypeError:无法读取未定义at (C:...\node_modules\typescript\lib\typescript.js:66675:26) at Object.getNewLineCharacter Object.createCompilerHost at Object.ngcLoader (C:...\node_modules\@ngtools\webpack\src\loader.js:386:33):TypeError:无法读取未定义属性“newLine”的属性“newLine”
未找到./src/main.ts模块中的错误:错误:无法
众所周知,默认的ng构建命令是
ng build --prod
在这里,我们都知道上面的命令将根据环境文件的配置构建/发布代码。
如果您有多个环境,如st/uat/gr/prod,则必须使用以下命令为特定环境构建:
ng build --configuration st
ng build --configuration gr
ng build --configuration uat
ng build --configuration prod
我的问题是,为什么我们不能在不使用“--配置”的情况下进行构建,如下所示:
ng build --st
ng build --gr
ng bu
我有一个使用Angluar创建的虚拟多项目Angular工作区,就像这里所述的https://angular.io/guide/creating-libraries,就在我的工作区中,我有库和应用程序,这意味着我执行了以下命令: ng new my-workspace --create-application=false
cd my-workspace
ng generate library my-lib
ng generate application my-app 我想在包json中创建一个npm脚本,它将创建库和应用程序的生产版本,所以在package.json中我添加了: "s