Angular v9 Integration
How to integration Web Essentials with Angular v9
Web Essentials and @angular-devkit/build-angular Instructions
The @angular-devkit/build-angular package builds Angular applications. HeroDevs provides neverendingsupport for @angular-devkit/build-angular used with Angular v9.
The version of @angular-devkit/build-angular used with Angular v9 has direct and transitive dependencies on various packages with CVEs. The following Web Essentials products are secured versions of the OSS alternatives used by @angular-devkit/build-angular:
This guide explains how to integrate these Web Essentials packages with @angular-devkit/build-angular.
Update your package.json
Below is an example package.json showing how to integrate the HeroDevs NES version of @angular-devkit/build-angular, with these Web Essentials packages. This package.json assumes your project uses Angular v9 NES.
{
"scripts": {
"postinstall": "npx ngnes"
},
"devDependencies": {
"@neverendingsupport/angular-tools": "1.1.3",
"@angular/cli": "npm:@neverendingsupport/angular-cli@9.1.15-cli-9.1.16",
"@angular/compiler-cli": "npm:@neverendingsupport/angular@9.1.13-compiler-cli-9.1.16",
"@angular-devkit/build-angular": "npm:@neverendingsupport/angular-cli@9.1.15-build-angular-9.1.16",
"webpack-dev-middleware": "npm:@neverendingsupport/webpack-dev-middleware@3.7.3-webpack-dev-middleware-3.7.4",
"ip": "npm:@neverendingsupport/ip@1.1.9-ip-1.1.10",
"http-proxy-middleware": "npm:@neverendingsupport/http-proxy-middleware@0.19.2-http-proxy-middleware-0.19.3"
},
"overrides": {
"@angular/cli": { ".": "npm:@neverendingsupport/angular-cli@9.1.15-cli-9.1.16"},
"@angular-devkit/build-angular": { ".": "npm:@neverendingsupport/angular-cli@9.1.15-build-angular-9.1.16"},
"@angular/compiler-cli": { ".": "npm:@neverendingsupport/angular@9.1.13-compiler-cli-9.1.16" },
"webpack-dev-middleware": { ".": "npm:@neverendingsupport/webpack-dev-middleware@3.7.3-webpack-dev-middleware-3.7.4" },
"ip": { ".": "npm:@neverendingsupport/ip@1.1.9-ip-1.1.10"},
"http-proxy-middleware": { ".": "npm:@neverendingsupport/http-proxy-middleware@0.19.2-http-proxy-middleware-0.19.3" }
}
}
Note
The Web Essentials products can also be used with the OSS version of @angular-devkit/build-angular (v0.901.15). In that case, simply install the Web Essentials products according to their individual instructions: ip, http-proxy-middleware, webpack-dev-middleware
FAQs
Why do I still see CVEs in the npm audit report
?
If you notice that that the CVEs have not dropped out of the npm audit
report/
scanning tools, please ensure that you are using a version of npm that supports
overrides. For example, this version of npm supports overrides: npm install -g npm@8.19.4
Note
You can install higher versions of npm (8.19.4), while remaining on lower versions of node (12.13.0).
Why is the postinstall script failing?
Some environmental configurations involving old versions of Node (v12) and/or
Python (v2.7) may result in errors when executing the ngnes
postinstall
script. If this is the case, please follow these steps:
- Delete the postinstall script from your package.json
- Install dependencies as normal (
npm install
) - Once dependencies are installed, run
npx ngnes
- Build and server your application using project-specific commands (.e.g,
npm run build
)