Skip to content

Commit

Permalink
fix(@angular/cli): work around npm peerdep issue
Browse files Browse the repository at this point in the history
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 angular#9691 (comment) and npm/npm#19877 for more information.

Fix angular#9691.
  • Loading branch information
filipesilva committed Feb 21, 2018
1 parent 77d2cd3 commit 72a057a
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 11 deletions.
75 changes: 64 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"@angular-devkit/schematics": "0.3.1",
"@schematics/angular": "0.3.1",
"@schematics/package-update": "0.3.1",
"ajv": "^6.1.1",
"autoprefixer": "^7.2.3",
"cache-loader": "^1.2.0",
"chalk": "~2.2.0",
Expand Down
6 changes: 6 additions & 0 deletions packages/@angular/cli/lib/cli/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// We don't actually require AJV, but there is a bug with NPM and peer dependencies that is
// whose workaround is to depend on AJV.
// See https://github.com/angular/angular-cli/issues/9691#issuecomment-367322703 for details.
// We need to add a require here to satisfy the dependency checker.
// require('ajv');

import * as path from 'path';

const cli = require('../../ember-cli/lib/cli');
Expand Down
1 change: 1 addition & 0 deletions packages/@angular/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@ngtools/webpack": "1.10.0-rc.0",
"@schematics/angular": "0.3.1",
"@schematics/package-update": "0.3.1",
"ajv": "^6.1.1",
"autoprefixer": "^7.2.3",
"cache-loader": "^1.2.0",
"chalk": "~2.2.0",
Expand Down

0 comments on commit 72a057a

Please sign in to comment.