angular-cli: Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.1.1 <3.3", would install "3.4.5").
🐞 Bug report
Command (mark with an x
)
- [ ] new
- [ ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [X] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc
Is this a regression?
Yes
Yes, the previous version in which this bug was not present was: ....Description
Having this issue trying to do an ng update on a pretty stock angular 7 application to angular 8:
ng update @angular/cli
Your global Angular CLI version (8.0.0) is greater than your local
version (7.3.8). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.1.1 <3.3", would install "3.4.5").
Incompatible peer dependencies found. See above.
package.json:
{
"name": "sample-player",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~7.2.0",
"@angular/common": "~7.2.0",
"@angular/compiler": "~7.2.0",
"@angular/core": "~7.2.0",
"@angular/forms": "~7.2.0",
"@angular/platform-browser": "~7.2.0",
"@angular/platform-browser-dynamic": "~7.2.0",
"@angular/router": "~7.2.0",
"core-js": "^2.5.4",
"rxjs": "~6.3.3",
"tslib": "^1.9.0",
"videogular2": "^6.4.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.13.0",
"@angular/cli": "~7.3.8",
"@angular/compiler-cli": "~7.2.0",
"@angular/language-service": "~7.2.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.2.2"
}
}
🔬 Minimal Reproduction
🔥 Exception or Error
🌍 Your Environment
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 37 (5 by maintainers)
Links to this issue
Commits related to this issue
- fix(@schematics/update): remove update all suggestion message The language within the message specifies that update all will _try_ to update all the packages. In practice and especially for larger p... — committed to clydin/angular-cli by clydin 5 years ago
- fix(@schematics/update): remove update all suggestion message The language within the message specifies that update all will _try_ to update all the packages. In practice and especially for larger p... — committed to angular/angular-cli by clydin 5 years ago
- fix(@schematics/update): remove update all suggestion message The language within the message specifies that update all will _try_ to update all the packages. In practice and especially for larger p... — committed to angular/angular-cli by clydin 5 years ago
Also, do we have to do a git commit after every update operation??
Ran into this as well. The only way I could get angular to upgrade 8 (from 7) was to use
npm install @angular/cli@8.0.0 --save-dev
(opposed tong update @angular/cli
once I did this, I ran into the issue @jtsom called out:
Once I committed the changes and ran
ng update --all
, I get more warnings:Hi, are you running
ng update @angular/cli @angular/core
? You need to update both the CLI and the framework at the same time.I had the same errors. Here’s what worked for me:
I ran the following to update the global version of the Angular CLI:
npm i -g @angular/cli@8.0.0
Then I ran the following to update my angular project:
ng update --all --force
Note: It’s important to have a clean, up-to-date repo before running trying to update
i also meet this error. first,i run
and them
i don’t run
now i have upgraded to angular8 and every thing sees ok. i hope it is helpful
run this command
git status --porcelain
and add files and directories to ignore file or commitThe problem is, usually Angular follows new Typescript releases from a few months behind and once there is a new Typescript version,
ng update --all
becomes unusable. The only solutions that I can think are adding an option to:Am updating the angular 7 to 8, after updating the
ng update @angular/cli @angular/core
command updated successfully, but after updating the material throughng update @angular/material entered
, then i got the error.Repository is not clean. Please commit or stash any changes before updating.
Thanks, seems to be working! Btw, you made a little spelling mistake in your
ng update @angular/cil
command, it should beng update @angular/cli
@mswilson4040 same problem, Finally I use npm to update angular, like this:
After update, you should manually add parameter to
ViewChild
orContentChild
Seems like
ng update
is just getting more finicky and fragile with every release.If
ng update --all
doesn’t work, then it should be removed.Or at the very least, this message should be changed:
Before you use
ng update
, you should commit or stash all files