Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
billfranklin opened this issue Nov 29, 2018 · 31 comments · Fixed by #18888

Comments

@billfranklin
Copy link

billfranklin commented Nov 29, 2018

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

@KrzysztofKarol
Copy link

KrzysztofKarol commented Nov 29, 2018

Hi @billfranklin
It's normal behavior.
Latest @angular/angular-cli:7.1.0 is shipped with typescript:3.1.6 and supports only patches: typescript < 3.2.
Newest typescript:3.2.1 increments minor version (typescript:3.1.6 in @angular/angular-cli:7.1.0) and should not have breaking changes but it's safer to limit typescript updates to patches.

See https://semver.org/
#13095 (comment)

@ngbot ngbot bot added this to the needsTriage milestone Nov 30, 2018
@billfranklin
Copy link
Author

billfranklin commented Dec 1, 2018

Hi @billfranklin
It's normal behavior.
Latest @angular/angular-cli:7.1.0 is shipped with typescript:3.1.6 and supports only patches: typescript < 3.2.
Newest typescript:3.2.1 increments minor version (typescript:3.1.6 in @angular/angular-cli:7.1.0) and should not have breaking changes but it's safer to limit typescript updates to patches.

See https://semver.org/

It's normal behavior for ng update to throw errors? Seems like bad design to me...

This is the error generated while it is trying to update the compiler-cli...should be fixed to NOT try to install an incompatible dependency

@Binero
Copy link

Binero commented Dec 2, 2018

@KrzysztofKarol This also makes it impossible to install "@angular/cli" with the latest version of "@angular/core". I don't see how that's normal behaviour. Surely the latest version of the CLI should be compatible with the latest version of the framework?

@KrzysztofKarol
Copy link

KrzysztofKarol commented Dec 2, 2018

@billfranklin Sorry, I mistook ng-update with https://www.npmjs.com/package/npm-check-updates.
Yes, this is a bug. ng-update should update typescript to latest supported version.
But I don't think it will be resolved soon: #11138 (comment).

@dalu You can do:
ng update --all --force
and then
npm i [email protected] (or even better: npm i typescript@"<3.2")

@JosepAlacid
Copy link

JosepAlacid commented Dec 2, 2018

@angular/service-worker wrong peerDependency in 7.1.0 angular/angular#27233 is referencing back to this issue!

@rakishii13
Copy link

Will this be updated soon?

@rakishii13
Copy link

#13123

@FrancescoBorzi
Copy link

same issue here

@JosepAlacid
Copy link

JosepAlacid commented Dec 4, 2018

rakishii13, this is #13123
image

and references back here...

@avatsaev
Copy link

avatsaev commented Dec 4, 2018

this has always been an issue, it's not even new.

@rogerfar
Copy link

rogerfar commented Dec 5, 2018

Can't ng update just try to install the latest compatible version of TypeScript? Now I have to go through each package and check if it's compatible with Angular because it errors out right away.

@mevsungur
Copy link

mevsungur commented Dec 6, 2018

I solved this issue via;

ng update --all --force

@JimmyRare
Copy link

npm install typescript@">=3.1.1 <3.2"

@Superman2971
Copy link

Not sure if this will help anyone else, but I was running the following to no avail:
ng update --all --force
npm install typescript@">=3.1.1 <3.2"

I needed to add RUN npm install typescript@">=3.1.1 <3.2" to my Dockerfile just after it completed an npm install of my package.json. Not sure if anyone else needs this pointed out, but wanted to mention in case it helps anyone else. Cheers!

@TylerOrtiz
Copy link

I tried updating via the documentation and I was getting an issue with the ng-http-loader package when I attempted to use the update command as documented (ng update @angular/core)

Package "ng-http-loader" has an incompatible peer dependency to "@angular/common" (requires "~7.0.0" (extended), would install "7.2.1").
Package "ng-http-loader" has an incompatible peer dependency to "@angular/core" (requires "~7.0.0" (extended), would install "7.2.1").

So I attempted to update it ng-http-loader by itself and this happened:


ng update ng-http-loader
    Updating package.json with dependency @angular/language-service @ "7.2.1" (was "6.1.10")...
    Updating package.json with dependency @angular/compiler-cli @ "7.2.1" (was "6.1.10")...
    Updating package.json with dependency @angular/animations @ "7.2.1" (was "6.1.10")...
    Updating package.json with dependency @angular/forms @ "7.2.1" (was "6.1.10")...
    Updating package.json with dependency @angular/core @ "7.2.1" (was "6.1.10")...
    Updating package.json with dependency @angular/http @ "7.2.1" (was "6.1.10")...
    Updating package.json with dependency @angular/compiler @ "7.2.1" (was "6.1.10")...
    Updating package.json with dependency @angular/common @ "7.2.1" (was "6.1.10")...
    Updating package.json with dependency @angular/platform-browser @ "7.2.1" (was "6.1.10")...
    Updating package.json with dependency @angular/router @ "7.2.1" (was "6.1.10")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "7.2.1" (was "6.1.10")...
    Updating package.json with dependency ng-http-loader @ "5.0.0" (was "3.2.0")...
    Updating package.json with dependency typescript @ "3.2.4" (was "2.7.2")...
    Updating package.json with dependency zone.js @ "0.8.28" (was "0.8.27")...
UPDATE package.json (3402 bytes)

All of my packages updated to v7.2.1 related to Angular.

@terryjray
Copy link

For what it's worth, I started out just trying:

ng update @angular/cli @angular/core

but that failed with the error in the title of this issue. Next, I tried just upgrading typescript first, then I found I was able update everything else. I found through trial and error that I had to use a specific version of typescript which is 3.1.6.

Here's what I did. I can't guarantee this was all that I did :) but I believe this is what worked:

npm i [email protected] --save-dev --save-exact

ng update @angular/cli

ng update --all --force

So I'm upgraded to angular 7 at least. Got a few compile errors now in my Typescript code which were not there previously but I'm assuming those are related to TS deprecations. I was upgrading from Angular 6.0 -> 7.

9034725985 added a commit to onewyoming/onewyoming that referenced this issue Feb 20, 2019
ng update --all needs --force

[kus@localhost testastic]$ nvm install node
Downloading and installing node v11.10.0...
Downloading https://nodejs.org/dist/v11.10.0/node-v11.10.0-linux-x64.tar.xz...
######################################################################################################################################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v11.10.0 (npm v6.7.0)
[kus@localhost testastic]$ npm install -g yarn
/home/kus/.nvm/versions/node/v11.10.0/bin/yarn -> /home/kus/.nvm/versions/node/v11.10.0/lib/node_modules/yarn/bin/yarn.js
/home/kus/.nvm/versions/node/v11.10.0/bin/yarnpkg -> /home/kus/.nvm/versions/node/v11.10.0/lib/node_modules/yarn/bin/yarn.js
+ [email protected]
added 1 package in 0.314s
[kus@localhost testastic]$ npm install -g @angular/cli
/home/kus/.nvm/versions/node/v11.10.0/bin/ng -> /home/kus/.nvm/versions/node/v11.10.0/lib/node_modules/@angular/cli/bin/ng
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@angular/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @angular/[email protected]
added 295 packages from 179 contributors in 9.558s
[kus@localhost testastic]$ ng serve
Your global Angular CLI version (7.3.2) is greater than your local
version (7.3.1). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

Date: 2019-02-20T23:10:58.553Z
Hash: ff523c7c37b0a81903de
Time: 7175ms
chunk {main} main.js, main.js.map (main) 11.6 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 237 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 16.7 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 3.74 MB [initial] [rendered]
ℹ 「wdm」: Compiled successfully.
^C
[kus@localhost testastic]$ ng update
Your global Angular CLI version (7.3.2) is greater than your local
version (7.3.1). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".
    We analyzed your package.json, there are some packages to update:

      Name                               Version                  Command to update
     --------------------------------------------------------------------------------
      @angular/cli                       7.3.1 -> 7.3.2           ng update @angular/cli
      @angular/core                      7.2.4 -> 7.2.6           ng update @angular/core

    There might be additional packages that are outdated.
    Run "ng update --all" to try to update all at the same time.

[kus@localhost testastic]$ ng update --all
Your global Angular CLI version (7.3.2) is greater than your local
version (7.3.1). 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.3.3")
                  Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.1.1 <3.3", would install "3.3.3").
Incompatible peer dependencies found. See above.
[kus@localhost testastic]$ ng update --all --force
Your global Angular CLI version (7.3.2) is greater than your local
version (7.3.1). 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.3.3")
                  Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=3.1.1 <3.3", would install "3.3.3").
    Updating package.json with dependency jasmine-core @ "3.3.0" (was "2.99.1")...
    Updating package.json with dependency @types/jasmine @ "3.3.9" (was "2.8.16")...
    Updating package.json with dependency karma-jasmine @ "2.0.1" (was "1.1.2")...
    Updating package.json with dependency karma-coverage-istanbul-reporter @ "2.0.5" (was "2.0.4")...
    Updating package.json with dependency karma-jasmine-html-reporter @ "1.4.0" (was "0.2.2")...
    Updating package.json with dependency @angular/language-service @ "7.2.6" (was "7.2.4")...
    Updating package.json with dependency @angular/compiler-cli @ "7.2.6" (was "7.2.4")...
    Updating package.json with dependency ts-node @ "8.0.2" (was "7.0.1")...
    Updating package.json with dependency @angular/cli @ "7.3.2" (was "7.3.1")...
    Updating package.json with dependency @angular/animations @ "7.2.6" (was "7.2.4")...
    Updating package.json with dependency tslint @ "5.12.1" (was "5.11.0")...
    Updating package.json with dependency @angular/common @ "7.2.6" (was "7.2.4")...
    Updating package.json with dependency @types/node @ "11.9.4" (was "8.9.5")...
    Updating package.json with dependency karma @ "4.0.0" (was "3.1.4")...
    Updating package.json with dependency @angular/compiler @ "7.2.6" (was "7.2.4")...
    Updating package.json with dependency @angular/forms @ "7.2.6" (was "7.2.4")...
    Updating package.json with dependency @angular/platform-browser-dynamic @ "7.2.6" (was "7.2.4")...
    Updating package.json with dependency @angular-devkit/build-angular @ "0.13.2" (was "0.12.4")...
    Updating package.json with dependency @angular/platform-browser @ "7.2.6" (was "7.2.4")...
    Updating package.json with dependency @angular/core @ "7.2.6" (was "7.2.4")...
    Updating package.json with dependency core-js @ "2.6.5" (was "2.6.4")...
    Updating package.json with dependency @angular/router @ "7.2.6" (was "7.2.4")...
    Updating package.json with dependency typescript @ "3.3.3" (was "3.2.4")...
UPDATE package.json (1495 bytes)
warning "@angular-devkit/build-angular > @ngtools/[email protected]" has incorrect peer dependency "typescript@>=2.4.0 < 3.3".
warning " > @angular/[email protected]" has incorrect peer dependency "typescript@>=3.1.1 <3.3".
[kus@localhost testastic]$ ng update
    We analyzed your package.json and everything seems to be in order. Good work!
[kus@localhost testastic]$

see angular/angular-cli#13095
9034725985 added a commit to onewyoming/onewyoming that referenced this issue Feb 21, 2019
ng compiler cannot into 3.3 +

ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.3.0 but 3.3.3 was found instead.

Angular Compiler refuses to work with the latest Typescript

[kus@localhost testastic]$ ./node_modules/@angular/cli/bin/ng test --progress false --watch=false
21 02 2019 11:12:48.459:INFO [karma-server]: Karma v4.0.0 server started at http://0.0.0.0:9876/
21 02 2019 11:12:48.464:INFO [launcher]: Launching browsers Chrome with concurrency unlimited
21 02 2019 11:12:48.471:INFO [launcher]: Starting browser Chrome
21 02 2019 11:12:51.432:INFO [Chrome 72.0.3626 (Linux 0.0.0)]: Connected on socket U_TPAhRL0Qtyi5JHAAAA with id 1972325
Chrome 72.0.3626 (Linux 0.0.0): Executed 3 of 3 SUCCESS (0.235 secs / 0.203 secs)
TOTAL: 3 SUCCESS
TOTAL: 3 SUCCESS
[kus@localhost testastic]$ ./node_modules/@angular/cli/bin/ng e2e
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

Date: 2019-02-21T16:16:28.716Z
Hash: 2e54be3b94885d563866
Time: 2675ms
chunk {main} main.js, main.js.map (main) 1.89 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 93.1 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 16.7 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 327 kB [initial] [rendered]

ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.3.0 but 3.3.3 was found instead.
[11:16:28] I/file_manager - creating folder /home/kus/src/wyoming/experimental/angular/testastic/node_modules/webdriver-manager/selenium
[11:16:28] I/config_source - curl -o/home/kus/src/wyoming/experimental/angular/testastic/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/
ℹ 「wdm」: Failed to compile.
[11:16:29] I/downloader - curl -o/home/kus/src/wyoming/experimental/angular/testastic/node_modules/webdriver-manager/selenium/chromedriver_2.46.zip https://chromedriver.storage.googleapis.com/2.46/chromedriver_linux64.zip
[11:16:32] I/update - chromedriver: unzipping chromedriver_2.46.zip
[11:16:32] I/update - chromedriver: setting permissions to 0755 for /home/kus/src/wyoming/experimental/angular/testastic/node_modules/webdriver-manager/selenium/chromedriver_2.46
[11:16:32] I/launcher - Running 1 instances of WebDriver
[11:16:32] I/direct - Using ChromeDriver directly...
Jasmine started
[11:16:44] E/protractor - Could not find Angular on page http://localhost:4200/ : retries looking for angular exceeded

  workspace-project App
    ✗ should display welcome message
      - Failed: Angular could not be found on the page http://localhost:4200/. If this is not an Angular application, you may need to turn off waiting for Angular.
                                Please see
                                https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
                                Please see
                                https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
          at executeAsyncScript_.then (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/protractor/built/browser.js:720:27)
          at ManagedPromise.invokeCallback_ (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/selenium-webdriver/lib/promise.js:1376:14)
          at TaskQueue.execute_ (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/selenium-webdriver/lib/promise.js:3084:14)
          at TaskQueue.executeNext_ (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/selenium-webdriver/lib/promise.js:3067:27)
          at asyncRun (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/selenium-webdriver/lib/promise.js:2927:27)
          at /home/kus/src/wyoming/experimental/angular/testastic/node_modules/selenium-webdriver/lib/promise.js:668:7
          at processTicksAndRejections (internal/process/next_tick.js:81:5)
      From: Task: Run it("should display welcome message") in control flow
          at UserContext.<anonymous> (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/jasminewd2/index.js:94:19)
          at /home/kus/src/wyoming/experimental/angular/testastic/node_modules/jasminewd2/index.js:64:48
          at ControlFlow.emit (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/selenium-webdriver/lib/events.js:62:21)
          at ControlFlow.shutdown_ (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/selenium-webdriver/lib/promise.js:2674:10)
          at shutdownTask_.MicroTask (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/selenium-webdriver/lib/promise.js:2599:53)
      From asynchronous test:
      Error
          at Suite.<anonymous> (/home/kus/src/wyoming/experimental/angular/testastic/e2e/src/app.e2e-spec.ts:11:3)
          at Object.<anonymous> (/home/kus/src/wyoming/experimental/angular/testastic/e2e/src/app.e2e-spec.ts:4:1)
          at Module._compile (internal/modules/cjs/loader.js:734:30)
          at Module.m._compile (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/ts-node/src/index.ts:413:23)
          at Module._extensions..js (internal/modules/cjs/loader.js:745:10)
          at Object.require.extensions.(anonymous function) [as .ts] (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/ts-node/src/index.ts:416:12)
      - Expected [ Entry({ level: SEVERE, message: 'http://localhost:4200/ - Failed to load resource: the server responded with a status of 404 (Not Found)', timestamp: 1550765794789, type: '' }), Entry({ level: SEVERE, message: 'http://localhost:4200/favicon.ico - Failed to load resource: the server responded with a status of 404 (Not Found)', timestamp: 1550765794814, type: '' }) ] not to contain <jasmine.objectContaining(Object({ level: SEVERE }))>.
          at Object.<anonymous> (/home/kus/src/wyoming/experimental/angular/testastic/e2e/src/app.e2e-spec.ts:19:22)
          at step (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/tslib/tslib.js:133:27)
          at Object.next (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/tslib/tslib.js:114:57)
          at fulfilled (/home/kus/src/wyoming/experimental/angular/testastic/node_modules/tslib/tslib.js:104:62)
          at processTicksAndRejections (internal/process/next_tick.js:81:5)

**************************************************
*                    Failures                    *
**************************************************

1) workspace-project App should display welcome message
  - Failed: Angular could not be found on the page http://localhost:4200/. If this is not an Angular application, you may need to turn off waiting for Angular.
                            Please see
                            https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular-on-page-load
  - Expected [ Entry({ level: SEVERE, message: 'http://localhost:4200/ - Failed to load resource: the server responded with a status of 404 (Not Found)', timestamp: 1550765794789, type: '' }), Entry({ level: SEVERE, message: 'http://localhost:4200/favicon.ico - Failed to load resource: the server responded with a status of 404 (Not Found)', timestamp: 1550765794814, type: '' }) ] not to contain <jasmine.objectContaining(Object({ level: SEVERE }))>.

Executed 1 of 1 spec (1 FAILED) in 10 secs.
[11:16:45] I/launcher - 0 instance(s) of WebDriver still running
[11:16:45] I/launcher - chrome #1 failed 1 test(s)
[11:16:45] I/launcher - overall: 1 failed spec(s)
[11:16:45] E/launcher - Process exited with error code 1
An unexpected error occurred: undefined
[kus@localhost testastic]$ ng serve
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

Date: 2019-02-21T16:17:20.600Z
Hash: 2e54be3b94885d563866
Time: 2571ms
chunk {main} main.js, main.js.map (main) 1.89 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 93.1 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 16.7 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 327 kB [initial] [rendered]

ERROR in The Angular Compiler requires TypeScript >=3.1.1 and <3.3.0 but 3.3.3 was found instead.
ℹ 「wdm」: Failed to compile.
^C
[kus@localhost testastic]$ yarn install [email protected]
yarn install v1.13.0
error `install` has been replaced with `add` to add new dependencies. Run "yarn add [email protected]" instead.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
[kus@localhost testastic]$ yarn add [email protected]
yarn add v1.13.0
[1/4] Resolving packages...
Couldn't find any versions for "typescript" that matches "3.3.0"
? Please choose a version of "typescript" from this list: 3.2.4
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Saved lockfile.
warning "typescript" is already in "devDependencies". Please remove existing entry first before adding it to "dependencies".
success Saved 0 new dependencies.
Done in 21.20s.
[kus@localhost testastic]$ yarn remove typescript
yarn remove v1.13.0
[1/2] Removing module typescript...
[2/2] Regenerating lockfile and installing missing dependencies...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
warning "@angular-devkit/build-angular > @ngtools/[email protected]" has unmet peer dependency "typescript@>=2.4.0 < 3.3".
warning " > @angular/[email protected]" has unmet peer dependency "typescript@>=3.1.1 <3.3".
warning " > [email protected]" has unmet peer dependency "typescript@>=2.0".
warning " > [email protected]" has unmet peer dependency "typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev".
warning "tslint > [email protected]" has unmet peer dependency "typescript@>=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev".
success Uninstalled packages.
Done in 4.73s.
[kus@localhost testastic]$ yarn add [email protected]
yarn add v1.13.0
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved 0 new dependencies.
Done in 4.08s.
[kus@localhost testastic]$ ng serve
** Angular Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **

Date: 2019-02-21T16:21:50.744Z
Hash: 19425012eff44487f3cb
Time: 7043ms
chunk {main} main.js, main.js.map (main) 11.6 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 237 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.08 kB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 16.7 kB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 3.75 MB [initial] [rendered]
ℹ 「wdm」: Compiled successfully.
^C
[kus@localhost testastic]$

see also angular/angular-cli#13095

fixes https://gitlab.com/wyoming/wyoming.gitlab.io/-/jobs/165335465
@alvipeo
Copy link

alvipeo commented Mar 27, 2019

This just hit me again with typescript 3.3.4. Why have this automatic update which gets destroyed by the higher version of typescript?

@JosepAlacid
Copy link

JosepAlacid commented Mar 30, 2019

Every time I go on ng update this issue still apears. Even at angular-cli 7.3.6.
It's solved just with:
npm i [email protected]
just after ng update as this is the last typescript version accepted.

@alan-agius4
Copy link
Collaborator

Another reproduction with some more details can be found here: #14420 (comment)

@jbmetrics
Copy link

I had the same problem upgrading from [email protected] to the latest 7.2.15 and had the error come up with [email protected] (well within the >= 3.1.1 < 3.3 requirement). The solution was to manually install the following:

npm i ajv@latest
npm i [email protected]
npm audit fix --force

Then my project compiled successfully with zero vulnerabilities or warnings showing up. I hope this helps others getting the same error message

@simeyla
Copy link

simeyla commented Jul 25, 2019

EVERY
SINGLE
TIME

@jcompagner
Copy link

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?

@alvipeo
Copy link

alvipeo commented Aug 2, 2019

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.

@VagrantAI-c
Copy link

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.

@wesleyrover
Copy link

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"
}
}

@rogerfar
Copy link

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.

@omar-dulaimi
Copy link

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?

@asalam345
Copy link

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

@rogerfar
Copy link

@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.

@asalam345
Copy link

@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.

alan-agius4 added a commit that referenced this issue Sep 29, 2020
'--all' functionality has been removed from `ng update` as updating multiple packages at once is not recommended. To update the depencencies in your workspace 'package.json' use the update command of your package manager.

Closes #15278
Closes #13095
Closes #12261
Closes #12243
Closes #18813
@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.