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 `ajv-keywords@3.1.0` are `webpack` and `schema-utils`.

See #9691 (comment) and npm/npm#19877 for more information.

Fix #9691.
  • Loading branch information
filipesilva authored and hansl committed Feb 22, 2018
1 parent 02ee393 commit ffc2e98
Show file tree
Hide file tree
Showing 4 changed files with 73 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
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
7 changes: 7 additions & 0 deletions packages/@angular/cli/lib/cli/index.ts
@@ -1,3 +1,10 @@
// TODO: remove this commented AJV require.
// 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
Expand Up @@ -34,6 +34,7 @@
"@ngtools/webpack": "1.10.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 ffc2e98

Please sign in to comment.