-
Notifications
You must be signed in to change notification settings - Fork 12k
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
Comments
|
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 |
@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? |
@billfranklin Sorry, I mistook ng-update with https://www.npmjs.com/package/npm-check-updates. @dalu You can do: |
@angular/service-worker wrong peerDependency in 7.1.0 angular/angular#27233 is referencing back to this issue! |
Will this be updated soon? |
same issue here |
rakishii13, this is #13123 and references back here... |
this has always been an issue, it's not even new. |
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. |
I solved this issue via;
|
npm install typescript@">=3.1.1 <3.2" |
Not sure if this will help anyone else, but I was running the following to no avail: I needed to add |
I tried updating via the documentation and I was getting an issue with the
So I attempted to update it
All of my packages updated to v7.2.1 related to Angular. |
For what it's worth, I started out just trying:
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:
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. |
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
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
This just hit me again with typescript 3.3.4. Why have this automatic update which gets destroyed by the higher version of typescript? |
Every time I go on |
Another reproduction with some more details can be found here: #14420 (comment) |
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:
Then my project compiled successfully with zero vulnerabilities or warnings showing up. I hope this helps others getting the same error message |
EVERY |
i really don't get this, what is the use of "ng update" when it is not really usable at all? |
ng update --all --force 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.
|
I was having trouble starting npm install.
Thanks for the help. package.json { |
Very similar to what I have in my package.json file:
Saves me the headache of updating. |
Thank you! |
Actually I have several projects. One of my projects couldn't solve. |
@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. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Command (mark with an
x
)Versions
Repro steps
The log given by the failure
Incompatible peer dependencies found. See above.
Desired functionality
Mention any other details that might be useful
The text was updated successfully, but these errors were encountered: