Skip to content

Commit ffc2e98

Browse files
filipesilvahansl
authored andcommitted
fix(@angular/cli): work around npm peerdep issue
NPM hoists dependencies with peerDeps of their own, leading to unmet peer dependencies. This workaround should be safe for now since the only two packages that depend on `[email protected]` are `webpack` and `schema-utils`. See #9691 (comment) and npm/npm#19877 for more information. Fix #9691.
1 parent 02ee393 commit ffc2e98

File tree

4 files changed

+73
-11
lines changed

4 files changed

+73
-11
lines changed

package-lock.json

Lines changed: 64 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"@angular-devkit/schematics": "0.3.1",
4747
"@schematics/angular": "0.3.1",
4848
"@schematics/package-update": "0.3.1",
49+
"ajv": "^6.1.1",
4950
"autoprefixer": "^7.2.3",
5051
"cache-loader": "^1.2.0",
5152
"chalk": "~2.2.0",

packages/@angular/cli/lib/cli/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
// TODO: remove this commented AJV require.
2+
// We don't actually require AJV, but there is a bug with NPM and peer dependencies that is
3+
// whose workaround is to depend on AJV.
4+
// See https://github.com/angular/angular-cli/issues/9691#issuecomment-367322703 for details.
5+
// We need to add a require here to satisfy the dependency checker.
6+
// require('ajv');
7+
18
import * as path from 'path';
29

310
const cli = require('../../ember-cli/lib/cli');

packages/@angular/cli/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
"@ngtools/webpack": "1.10.0",
3535
"@schematics/angular": "0.3.1",
3636
"@schematics/package-update": "0.3.1",
37+
"ajv": "^6.1.1",
3738
"autoprefixer": "^7.2.3",
3839
"cache-loader": "^1.2.0",
3940
"chalk": "~2.2.0",

0 commit comments

Comments
 (0)