angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.1.1 <3.2", would install "3.2.1")

Open billfranklin opened this issue 8 years ago • 31 comments

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

              Node Version: v8.11.4
              npm Version: 6.4.1
              ng Version: 
              Angular CLI: 7.0.4
              Node: 8.11.4
              OS: win32 x64
              Angular: 7.0.2
              ... animations, common, compiler, compiler-cli, core, forms
              ... http, language-service, platform-browser
              ... platform-browser-dynamic, router

              Package                           Version
              -----------------------------------------------------------
              @angular-devkit/architect         0.10.4
              @angular-devkit/build-angular     0.10.4
              @angular-devkit/build-optimizer   0.10.4
              @angular-devkit/build-webpack     0.10.4
              @angular-devkit/core              7.0.4
              @angular-devkit/schematics        7.0.4
              @angular/cli                      7.0.4
              @ngtools/webpack                  7.0.4
              @schematics/angular               7.0.4
              @schematics/update                0.10.4
              rxjs                              6.3.3
              typescript                        3.1.6
              webpack                           4.19.1

Repro steps

              ng update --all

The log given by the failure

              Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.1.1 <3.2", would install "3.2.1")
              Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.1.1 <3.2", would install "3.2.1").

Incompatible peer dependencies found. See above.

Desired functionality

Mention any other details that might be useful

billfranklin avatar Nov 29 '18 21:11 billfranklin

EVERY SINGLE TIME

simeyla avatar Jul 25 '19 01:07 simeyla

i really don't get this, what is the use of "ng update" when it is not really usable at all? Why is something that updates angular that understands angular not be able to leave typescript alone or upgrade it to the latest supported version?

jcompagner avatar Aug 02 '19 14:08 jcompagner

ng update --all --force ~~npm install [email protected] --save-exact~~ (you don't even need this anymore with angular 8.2.0, it works with the latest [email protected])

That's my version of ng update.

alvipeo avatar Aug 02 '19 15:08 alvipeo

ng update --all --force ~npm install [email protected] --save-exact~ (you don't even need this anymore with angular 8.2.0, it works with the latest [email protected])

That's my version of ng update.

This is not an option since versions always are bumping. E.g. now it states that @angular/core conflicts with latest zone.js version and tsickle conflicts with latest typescript version.

ng update definetly should take care of its own dependencies at least.

VagrantAI-c avatar Aug 03 '19 22:08 VagrantAI-c

I was having trouble starting npm install. [- ERROR in The Angular Compiler requires TypeScript> = 3.4.0 and <3.6.0 but 3.6.3 was found instead.]

  • The commands:
  • ng update --all --force
  • npm install typescript @ "> = 3.1 <3.6"
  • npm strat (success)

Thanks for the help.

package.json

{ "name": "my-project", "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": "~8.2.6", "@angular/common": "~8.2.6", "@angular/compiler": "~8.2.6", "@angular/core": "~8.2.6", "@angular/forms": "~8.2.6", "@angular/platform-browser": "~8.2.6", "@angular/platform-browser-dynamic": "~8.2.6", "@angular/router": "~8.2.6", "core-js": "^3.2.1", "rxjs": "~6.5.3", "tslib": "^1.10.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-devkit/build-angular": "~0.803.4", "@angular/cli": "~8.3.4", "@angular/compiler-cli": "~8.2.6", "@angular/language-service": "~8.2.6", "@types/jasmine": "~3.4.0", "@types/jasminewd2": "~2.0.6", "@types/node": "~12.7.5", "codelyzer": "~5.1.0", "jasmine-core": "~3.4.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~4.3.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~2.1.0", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.2", "protractor": "~5.4.2", "ts-node": "~8.3.0", "tslint": "~5.20.0", "typescript": "^3.5.3" } }

wesleyrover avatar Sep 15 '19 23:09 wesleyrover

Very similar to what I have in my package.json file:

  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "update": "ng update --all --force && npm install [email protected] && npm install [email protected]"
  },

Saves me the headache of updating.

rogerfar avatar Sep 16 '19 01:09 rogerfar

Very similar to what I have in my package.json file:

  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "update": "ng update --all --force && npm install [email protected] && npm install [email protected]"
  },

Saves me the headache of updating.

Thank you! But isn't typescipt supposed to be in the dev dependencies?

omar-dulaimi avatar Sep 29 '19 07:09 omar-dulaimi

Actually I have several projects. One of my projects couldn't solve. So I copy all app models and components and paste it to the success project and then do some necessary steps. npm install -g @angluar/cli ng update --all --force is works for me

asalam345 avatar Apr 28 '20 09:04 asalam345

@asalam345 this works for now, but not when a new TS version will come out. The CLI will just happily upgrade your packages to a version of TS that is incompatible with Angular.

rogerfar avatar Apr 28 '20 14:04 rogerfar

@asalam345 this works for now, but not when a new TS version will come out. The CLI will just happily upgrade your packages to a version of TS that is incompatible with Angular.

then need to update all I think.

asalam345 avatar May 05 '20 09:05 asalam345

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.