Angular CLI: 6.0.1
Node: 9.11.1
OS: darwin x64
Angular: 5.2.10
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.6.1
@angular-devkit/build-angular 0.6.1
@angular-devkit/build-optimizer 0.6.1
@angular-devkit/core 0.6.1
@angular-devkit/schematics 0.6.1
@angular/cli 6.0.1
@ngtools/webpack 6.0.1
@schematics/angular 0.6.1
@schematics/update 0.6.1
rxjs 5.5.10
typescript 2.5.3
webpack 4.6.0
macOS 10.11.6
upgrade
branch of repo https://github.com/juristr/ng-upgrade-testyarn install
(or npm install
=> I used yarn)ng update @angular/core
. I already performed the @angular/cli
upgrade command which adjusts the angular.json
etc.<!-- Normally this includes a stack trace and some more information. -->
I get the following output
❯ ng update @angular/core
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.8", would install "2.5.3")
Incompatible peer dependencies found. See above.
It should automatically update the Angular dependencies as well as RxJS and TypeScript (as described in the update.angular.io
guide).
@clydin Hi, I was chatting about this in the Angular Slack with @filipesilva and he told me to open the issue here. Let me know if you need more info. Thanks a lot 👍
I'm running into a similar issue when trying to update NgRx.
If I have all the @ngrx
libraries installed and I run ng update @ngrx/store --next
I get
Package "@ngrx/schematics" has a missing peer dependency of "@angular-devkit/core" @ "^0.6.0".
If I run yarn list @angular-devkit/core
, I see
@angular-devkit/[email protected]
Not sure if it's the same thing, but I'm getting errors like:
Package "bootstrap" has a missing peer dependency of "jquery" @ "1.9.1 - 3".
I'm using the bootstrap SCSS framework but have no intentions of ever including jQuery ofc. I dunno if this is a problem with bootstrap itself that it has jquery as a peerDep or if the problem is that CLI throws for peer dep WARN.
Is it perhaps possible to just force the ng update --all
?
I have the same issue, but instead run ng update @angular/compiler-cli
successfully without error.
I'm running into this issue as well, seems the updater is trying to install [email protected]
but @angular/compiler-cli
has a peer dependency of typescript@">=2.7.2 <2.8"
.
When I ran "ng update @angular/core" got the following errors and cannot upgrade to angular 6:
Package "angular2-resizable" has an incompatible peer dependency to "@angular/core" (requires ">=3.0.0-rc.0 <4.0.0||>=2.0.0 <3.0.0", would install "6.0.2").
Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires ">=5.0.0-rc.0 <6.0.0||>=2.3.1 <3.0.0||>=4.0.0-beta <5.0.0", would install "6.0.2").
Just so its noted, the workaround is to use the --force
flag when running ng update [package]
to override the dependency issues. This will upgrade the packages anyway and you can verify your app with the updated dependencies. If that third party dependency still needs to be updated because of breaking changes, then that package will need to be updated.
ng update @ngrx/store --next --force
@sachinpachori Those are actually legitimate errors. The project has a dependency (angular2-resizable
) that does not support Angular 6. As @brandonroberts mentions, the --force
flag can be used (with caution) to update while ignoring those issues.
And similar with codelyzer
; however, since codelyzer
is part of the default project this could potentially (and in the future) be automatically updated (depending on the pinning strategy) with a CLI update.
@brandonroberts @clydin thank you that solved my issue.
I could have faced incompatible peer dependency issues when i ran the command ng update @angular/core to update the core library of the existing angular project.
Issues
Package "@angular/cdk" has an incompatible peer dependency to "@angular/common" (requires ">=5.0.0-rc.0 <6.0.0||>=4.0.0 <5.0.0", would install "6.0.0").
Package "codelyzer" has an incompatible peer dependency to "@angular/core" (requires ">=5.0.0-rc.0 <6.0.0||>=2.3.1 <3.0.0||>=4.0.0-beta <5.0.0", would install "6.0.0").
Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires ">=5.0.0-rc.0 <6.0.0||>=2.3.1 <3.0.0||>=4.0.0-beta <5.0.0", would install "6.0.0").
in second time i used the following command to update the core library
ng update @angulsar/core --next but still there an issue.
issue had fix when i use the following command with --force flag,
ng update @angular/core --next --force
now, my project library has been updated from version 4 to 6. Well done :)
Good Luck !!!
ng update @angular/core --next --force works for me
I'm doing a fresh install of my npm modules, and running into this issue:
$ npm install -g @ngrx/schematics@latest
npm WARN @ngrx/[email protected] requires a peer of @angular-devkit/core@^0.6.0 but none is installed. You must install peer dependencies yourself.
npm WARN @ngrx/[email protected] requires a peer of @angular-devkit/schematics@^0.6.0 but none is installed. You must install peer dependencies yourself.
But angular-devkit/[email protected] is installed. Is using --force still the recommended workaround?
@Sharondio You're installing @ngrx/schematics@latest
globally. If that is intentional then the peer dependencies of the package would also need to be installed globally.
@clydin They are installed globally. Still getting error.
If npm ls -g --depth=0
doesn't show the warnings then everything should be fine.
Please note that this is actually an npm
issue (and possible a defect) and not a CLI issue.
So I figured out that ng update --all
doesn't work as expected,
so you better upgrade everything in order:
yarn global @angular/cli
ng update @angular/cli
yarn upgrade tsickle
ng update @angular/core
ng update @angular/material
ng update rxjs
yarn add @angular-devkit/schematics@^0.6.0 --dev
ng update @ngrx/store
ng update @nrwl/nx
Note that I had to update some dependencies because @angular/core
installs typescript 2.9.2
and the version I had of tsickle
didn't supported it:
Package "tsickle" has an incompatible peer dependency to "typescript" (requires ">=2.4.2 <2.9", would install "2.9.2").
and also @ngrx/store
had a missing dependency:
Package "@ngrx/schematics" has a missing peer dependency of "@angular-devkit/schematics" @ "^0.6.0".
Thanks for the great work!
I just ran
ng update --all --next --force
and the output was (ok):
Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires ">=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0", would install "6.1.0-rc.3")
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.10", would install "3.1.0-dev.20180802")
Package "@angular/cdk" has an incompatible peer dependency to "@angular/common" (requires ">=6.0.0-beta.0 <7.0.0" (extended), would install "6.1.0-rc.3").
Package "codelyzer" has an incompatible peer dependency to "@angular/compiler" (requires ">=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0" (extended), would install "6.1.0-rc.3").
Package "codelyzer" has an incompatible peer dependency to "@angular/core" (requires ">=2.3.1 <7.0.0 || >6.0.0-beta <7.0.0" (extended), would install "6.1.0-rc.3").
Package "@angular/compiler-cli" has an incompatible peer dependency to "typescript" (requires ">=2.7.2 <2.10", would install "3.1.0-dev.20180802").
Updating package.json with dependency karma-jasmine-html-reporter @ "1.2.0" (was "0.2.2")...
Updating package.json with dependency jasmine-core @ "3.1.0" (was "2.99.1")...
Updating package.json with dependency codelyzer @ "4.4.2" (was "4.2.1")...
Updating package.json with dependency protractor @ "5.4.0" (was "5.3.2")...
Updating package.json with dependency ts-node @ "7.0.0" (was "5.0.1")...
Updating package.json with dependency @angular/animations @ "6.1.0-rc.3" (was "6.0.9")...
Updating package.json with dependency @angular/compiler-cli @ "6.1.0-rc.3" (was "6.0.9")...
Updating package.json with dependency @angular/language-service @ "6.1.0-rc.3" (was "6.0.9")...
Updating package.json with dependency @angular/http @ "6.1.0-rc.3" (was "6.0.9")...
Updating package.json with dependency @angular/platform-browser @ "6.1.0-rc.3" (was "6.0.9")...
Updating package.json with dependency @angular/common @ "6.1.0-rc.3" (was "6.0.9")...
Updating package.json with dependency @angular/compiler @ "6.1.0-rc.3" (was "6.0.9")...
Updating package.json with dependency @angular/forms @ "6.1.0-rc.3" (was "6.0.9")...
Updating package.json with dependency @angular/core @ "6.1.0-rc.3" (was "6.0.9")...
Updating package.json with dependency @angular/router @ "6.1.0-rc.3" (was "6.0.9")...
Updating package.json with dependency @angular/platform-browser-dynamic @ "6.1.0-rc.3" (was "6.0.9")...
Updating package.json with dependency @types/node @ "10.5.5" (was "8.9.5")...
Updating package.json with dependency karma @ "2.0.5" (was "1.7.1")...
Updating package.json with dependency typescript @ "3.1.0-dev.20180802" (was "2.7.2")...
Updating package.json with dependency @angular-devkit/build-angular @ "0.8.0-beta.0" (was "0.6.8")...
UPDATE package.json (1662 bytes)
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN deprecated [email protected]: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm WARN deprecated [email protected]: All versions below 4.0.1 of Nodemailer are deprecated. See https://nodemailer.com/status/
npm WARN deprecated [email protected]: This project is unmaintained
npm WARN deprecated [email protected]: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0
npm WARN deprecated [email protected]: This project is unmaintained
> [email protected] install ...\node_modules\uws
> node-gyp rebuild > build_log.txt 2>&1 || exit 0
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, lstat '...\node_modules\fsevents\node_modules'
npm WARN [email protected] requires a peer of 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 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/[email protected] requires a peer of typescript@>=2.7.2 <2.10 but none is installed. You must install peer dependencies yourself.
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.
npm WARN [email protected] requires a peer of typescript@>=2.4.2 <2.9 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
added 120 packages from 165 contributors, removed 48 packages, updated 77 packages, moved 3 packages and audited 16744 packages in 47.871s
found 6 vulnerabilities (1 low, 5 moderate)
run `npm audit fix` to fix them, or `npm audit` for details
If anyone's still running into this error you could try running
npm i --save-dev [email protected] before running ng update @angular/core
instead of forcing ng update --next --force which ignores those warnings and installs beta packages.
it gave me a successful serve but in browser I got this error
AppComponent.html:1 ERROR TypeError: (intermediate value).switchMap is not a function
at new AngularFireAuth (auth.js:21)
at _getAngularFireAuth (auth.module.js:6)
at _callFactory (core.js:16720)
at _createProviderInstance (core.js:16676)
at resolveNgModuleDep (core.js:16636)
at _createClass (core.js:16709)
at _createProviderInstance (core.js:16673)
at resolveNgModuleDep (core.js:16636)
at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (core.js:17345)
at resolveDep (core.js:17716)
ng update @angular/cli@version --force it worked for me
ng update --all --force this worked for me.
Happening on update to Angular 7 and TypeScript 3.1 too.
Wow that's great news!
On Fri, 19 Oct 2018, 22:03 Luiz Machado, notifications@github.com wrote:
Happening on update to Angular 7 and TypeScript 3.1 too.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/angular/angular-cli/issues/10875#issuecomment-431422087,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEHilw6eaQ_YPfxUyF_6Z3H-xLP5NHaXks5umf7LgaJpZM4UAT9m
.
The update with --force
does work, but some packages like ng-packagr
breaks due to tsickle
version.
ng update @angular/cli this will do the trick
At this time, just the update as @demonguru18 said should work.
Here is an Starter Project I created for Asp.net Core 2.1, Angular 7.0.3 and Bootstrap 4.1.3 You can download this project and start. In case you want to start from scratch
https://github.com/demonguru18/Angular7DotNetCore2.1BootStrap4
If updating old project, follow this
first run ng update --all
then run ng update @angular/cli
Make sure you have update version of Jquery to run Bootsrap 4
Cheers 👍
** If you get an error saying,
Global Angular CLI version greater than local
Then first run this command:
npm install --save-dev @angular/cli@latest
then run
ng --update @angular/cli@latest
For Angular 7: first upgrade to [email protected]: https://github.com/mgechev/codelyzer/blob/master/CHANGELOG.md, after that, you can run the ng update @angular/cli command
Not sure if it's the same thing, but I'm getting errors like:
Package "bootstrap" has a missing peer dependency of "jquery" @ "1.9.1 - 3".
I'm using the bootstrap SCSS framework but have no intentions of ever including jQuery ofc. I dunno if this is a problem with bootstrap itself that it has jquery as a peerDep or if the problem is that CLI throws for peer dep WARN.
Is it perhaps possible to just force the
ng update --all
?
try
npm install --save bootstrap
Hi you need to upgrade jQuery to use bootstrap 4. In you package manager file change the version of jQuery. Like in my libman.json file i have it like this
{
"version": "1.0",
"defaultProvider": "cdnjs",
"libraries": [
{
"library": "[email protected]",
"destination": "wwwroot/lib/bootstrap/dist",
"files": [
"js/bootstrap.min.js",
"js/bootstrap.js",
"css/bootstrap.min.css",
"css/bootstrap-reboot.css",
"css/bootstrap-grid.css",
"css/bootstrap.css"
]
},
{
"library": "[email protected]",
"destination": "wwwroot/lib/jquery/dist",
"files": [
"jquery.min.js",
"jquery.js"
]
},
{
"library": "[email protected]",
"destination": "wwwroot/lib/popper.js/dist",
"files": [
"esm/popper-utils.min.js",
"esm/popper.js",
"umd/popper-utils.min.js",
"umd/popper.min.js",
"popper.min.js",
"popper-utils.min.js"
]
}
]
}
I've tried executing ng update --all --force but I still get the error
Tried:
ng update @angular/core --force
UPDATE package.json (1579 bytes)
npm WARN rollback Rolling back [email protected] failed (this is probably harmless): EPERM: operation not permitted, rmdir 'C:\Users\Ben\Projects\QuixxiStagingnode_modulesfseventsnode_modules'
npm WARN [email protected] requires a peer of @angular/core@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/compiler@^2.3.1 || >=4.0.0-beta <6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/core@^2.3.1 || >=4.0.0-beta <6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser-dynamic@^2.3.1 || >=4.0.0-beta <6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/platform-browser@^2.3.1 || >=4.0.0-beta <6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @angular/common@^2.3.1 || >=4.0.0-beta <6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
Hi, be careful with this command,
ng update @ angular / core --next --force,
I have used it to update from Angular 4 to 7 and now I have version 8.0.0-beta.3
@codemcu The --next
flag is probably not what people are expecting. From the Angular docs
--next=true|false Use the largest version, including beta and RCs
when bootstrapping angular application
What are the order priorites while bootstrapping and main-usage of those file, if any one knows Please clearly explain.
index.js
main.ts,
package.json,
tsconfig.json,
tsconfig.app.json,
tsconfig.spec.json,
angular.json
@adhivenkatesh the Angular Bootstapping Guide might be helpful as well as the Project File Structure Guide. However, I'm not sure that they address that exact question.
Yes , splaktar, good day, thanks for your revert, i will go through the angular bootstrapping guide, thank you.
Hi i think some of the files corrected i am using angular 7 version ,
i have tried in many angles deleted directory and remove ng_modules and installed npm command also nothing happened , here i also used npm cache clean --force , then remove ng_modules then npm install ,
i have created 3 new projects and again getting the same issue
please help with best solution ,
======================= error =============
ERROR in node_modules/rxjs/src/internal/scheduled/scheduled.ts(25,40): error TS2345: Argument of type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/internal/types").SchedulerLike' is not assignable to parameter of type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/src/internal/types").SchedulerLike'.
Types of property 'schedule' are incompatible.
Type '
Types of parameters 'work' and 'work' are incompatible.
The 'this' types of each signature are incompatible.
Type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/internal/types").SchedulerAction
Types of property 'schedule' are incompatible.
Type '(state?: T, delay?: number) => import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/internal/Subscription").Subscription' is not assignable to type '(state?: T, delay?: number) => import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/src/internal/Subscription").Subscription'.
Type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/internal/Subscription").Subscription' is not
assignable to type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/src/internal/Subscription").Subscription'.
Property '_parentOrParents' is protected but type 'Subscription' is not a class derived from 'Subscription'.
node_modules/rxjs/src/internal/scheduled/scheduled.ts(27,37): error TS2345: Argument of type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/internal/types").SchedulerLike' is not assignable to parameter of type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/src/internal/types").SchedulerLike'.
node_modules/rxjs/src/internal/scheduled/scheduled.ts(29,35): error TS2345: Argument of type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/internal/types").SchedulerLike' is not assignable to parameter of type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/src/internal/types").SchedulerLike'.
node_modules/rxjs/src/internal/scheduled/scheduled.ts(31,38): error TS2345: Argument of type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/internal/types").SchedulerLike' is not assignable to parameter of type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/src/internal/types").SchedulerLike'.
node_modules/rxjs/src/internal/observable/from.ts(116,29): error TS2345: Argument of type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/src/internal/types").SchedulerLike' is not assignable to parameter of type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/internal/types").SchedulerLike'.
Types of property 'schedule' are incompatible.
Type '
Types of parameters 'work' and 'work' are incompatible.
The 'this' types of each signature are incompatible.
Type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/src/internal/types").SchedulerAction
Types of property 'schedule' are incompatible.
Type '(state?: T, delay?: number) => import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/src/internal/Subscription").Subscription' is not assignable to type '(state?: T, delay?: number) => import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/internal/Subscription").Subscription'.
Type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/src/internal/Subscription").Subscription' is
not assignable to type 'import("D:/AngularProjects/AngularRouting/Routing/node_modules/rxjs/internal/Subscription").Subscription'.
@adhivenkatesh please open a new issue with a reproduction.
I am getting the same error when I am upgrading from version 5 to version 6 but running ng update @angular/core --next --force
is forcing update to the latest release: is there a workaround to update just to the version I want?
@Riccardo-Andreatta ng update @angular/core --migrate-only --from=5 --to=6 --force
. See more details in ng update --help
or https://angular.io/cli/update.
I didn't want to use --force
as it installs unstable packages and also... we shouldn't have to.
I found a solution to the above that worked for me. I installed the latest codelyzer
npm install codelyzer@latest --save-dev
then ran the ng update @
whatever I needed to do and it worked with no complaints.
Thanks charlie for your suggestion, will follow the suggestion when i get
any further issues/errors.
Thank You,
Adhi Venkatesh.,Banglore,India.
On Wed, Jul 3, 2019 at 10:38 PM Charlie Walter notifications@github.com
wrote:
I didn't want to use --force as it installs betas and also one shouldn't
have to.I found a solution to the above that worked for me. I installed the latest
codelyzernpm install codelyzer@latest
then ran the ng update @whatever I needed to do and it worked with no
complaints.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/angular/angular-cli/issues/10875?email_source=notifications&email_token=AG5YZMSI2J2LCKZXQHPFAPDP5US5HA5CNFSM4FABH5TKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZF3GNI#issuecomment-508277557,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AG5YZMW67XWJJ2HEUP42XCTP5US5HANCNFSM4FABH5TA
.
Reinstalling cli worked for me as it installed latest.
npm uninstall @angular/cli
npm install @angular/cli
after this all ng update worked
@Splaktar I have tried the --from
and --to
options but they are not working: still they are upgrading directly to the last version available.
I had to install the specific version (ng update @angular/[email protected]
) both for core and cli, and then update manually the package.json
to update every single module that my application needs (http
, common
, forms
, etc).
The --from
and --to
options will only affect the --migrate-only
option. CLI versions 8.0+ will now error if the options are used incorrectly.
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._
Most helpful comment
Just so its noted, the workaround is to use the
--force
flag when runningng update [package]
to override the dependency issues. This will upgrade the packages anyway and you can verify your app with the updated dependencies. If that third party dependency still needs to be updated because of breaking changes, then that package will need to be updated.