Angular-cli: Unable to update ngtools/webpack version to 7.0.1

Created on 26 Oct 2018  Â·  5Comments  Â·  Source: angular/angular-cli

Bug Report or Feature Request (mark with an x)

- [ x ] bug report -> please search issues before submitting
- [ ] feature request

Command (mark with an x)

- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ x ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Versions

Output from:
node --version: v8.11.3,
npm --version: 6.4.1 and
ng --version: Angular: 7.0.1
Angular CLI: 7.0.3
OS: darwin x64
macOS (High Sierra)

Repro steps

Trying to update Angular v6 to v7 using the commands provided on https://update.angular.io/

The log given by the failure

➜ npm install
npm WARN @ngtools/[email protected] requires a peer of typescript@~2.4.0 || ~2.5.0 || ~2.6.0 || ~2.7.0 || ~2.8.0 || ~2.9.0 but none is installed. You must install peer dependencies yourself.

audited 25017 packages in 12.447s
found 0 vulnerabilities

Desired functionality

[email protected] should also be updated to [email protected]

Mention any other details that might be useful

Output for ng --version

Package Version

@angular-devkit/architect 0.10.3
@angular-devkit/build-angular 0.8.3
@angular-devkit/build-optimizer 0.8.3
@angular-devkit/build-webpack 0.8.3
@angular-devkit/core 7.0.3
@angular-devkit/schematics 7.0.3
@angular/cli 7.0.3
@ngtools/webpack 6.2.3
@schematics/angular 7.0.3
@schematics/update 0.10.3
rxjs 6.3.3
typescript 3.1.3
webpack 4.20.2

schematicupdate bufix

Most helpful comment

We had the same issue after upgrading an Angular 6 project to Angular 7. This bug also broke the artifacts generated by ng build (presumably because the compiler used was for Angular 6).
Changing the "@angular-devkit/build-angular" package version to the latest one fixed the issue.

All 5 comments

Can you please share you package.json?

package.json before running ng update for cli and core

{
  "name": "test123",
  "version": "0.1.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "build:prod": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "6.0.3",
    "@angular/cdk": "6.2.0",
    "@angular/common": "6.0.3",
    "@angular/compiler": "6.0.3",
    "@angular/core": "6.0.3",
    "@angular/forms": "6.0.3",
    "@angular/http": "6.0.3",
    "@angular/material": "6.2.0",
    "@angular/platform-browser": "6.0.3",
    "@angular/platform-browser-dynamic": "6.0.3",
    "@angular/router": "6.0.3",
    "@ng-select/ng-select": "2.9.1",
    "@swimlane/ngx-datatable": "13.1.0",
    "angular2-query-builder": "0.3.3",
    "core-js": "2.5.4",
    "hammerjs": "2.0.8",
    "moment": "2.22.2",
    "ngx-cookie-service": "1.0.10",
    "rxjs": "6.0.0",
    "rxjs-compat": "6.0.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@angular/compiler-cli": "6.0.3",
    "@angular-devkit/build-angular": "0.8.3",
    "typescript": "2.7.2",
    "@angular/cli": "6.0.7",
    "@angular/language-service": "6.0.3",
    "@types/jasmine": "2.8.6",
    "@types/jasminewd2": "2.0.3",
    "@types/node": "8.9.4",
    "codelyzer": "4.2.1",
    "jasmine-core": "2.99.1",
    "jasmine-spec-reporter": "4.2.1",
    "karma": "3.0.0",
    "karma-chrome-launcher": "2.2.0",
    "karma-coverage-istanbul-reporter": "2.0.0",
    "karma-jasmine": "1.1.1",
    "karma-jasmine-html-reporter": "0.2.2",
    "protractor": "5.4.1",
    "ts-node": "5.0.1",
    "tslint": "5.9.1"
  }
}

package.json after running ng update for cli and core.

{
  "name": "test123",
  "version": "0.1.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "build:prod": "ng build --prod",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "7.0.1",
    "@angular/cdk": "7.0.1",
    "@angular/common": "7.0.1",
    "@angular/compiler": "7.0.1",
    "@angular/core": "7.0.1",
    "@angular/forms": "7.0.1",
    "@angular/http": "7.0.1",
    "@angular/material": "7.0.1",
    "@angular/platform-browser": "7.0.1",
    "@angular/platform-browser-dynamic": "7.0.1",
    "@angular/router": "7.0.1",
    "@ng-select/ng-select": "2.11.2",
    "@swimlane/ngx-datatable": "13.1.0",
    "angular2-query-builder": "0.3.3",
    "core-js": "2.5.4",
    "hammerjs": "2.0.8",
    "moment": "2.22.2",
    "ngx-cookie-service": "1.0.10",
    "rxjs": "6.3.3",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@angular/compiler-cli": "7.0.1",
    "@angular-devkit/build-angular": "0.8.3",
    "typescript": "3.1.3",
    "@angular/cli": "7.0.3",
    "@angular/language-service": "7.0.1",
    "@types/jasmine": "2.8.6",
    "@types/jasminewd2": "2.0.3",
    "@types/node": "8.9.4",
    "codelyzer": "4.5.0",
    "jasmine-core": "2.99.1",
    "jasmine-spec-reporter": "4.2.1",
    "karma": "3.0.0",
    "karma-chrome-launcher": "2.2.0",
    "karma-coverage-istanbul-reporter": "2.0.0",
    "karma-jasmine": "1.1.1",
    "karma-jasmine-html-reporter": "0.2.2",
    "protractor": "5.4.1",
    "ts-node": "5.0.1",
    "tslint": "5.9.1"
  }
}

We had the same issue after upgrading an Angular 6 project to Angular 7. This bug also broke the artifacts generated by ng build (presumably because the compiler used was for Angular 6).
Changing the "@angular-devkit/build-angular" package version to the latest one fixed the issue.

Closing as per @kdoul's answer. Build-angular must be updated as well.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings