ng --version
Your global Angular CLI version (6.0.5) is greater than your local
version (1.7.4). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ â–³ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 1.7.4
Node: 8.11.2
OS: win32 ia32
Angular: 5.2.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
@angular/cli: 1.7.4
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0
Use PowerShell with the current dotnet SDK (2.1.201), create an Angular template and then try to update it from angular 5 to 6 following the steps outlined here
dotnet new angular
cd .\ClientApp
npm install -g @angular/cli
npm install @angular/cli
ng update @angular/cli
ng update @angular/cli fails with the following error:
Your global Angular CLI version (6.0.5) is greater than your local
version (1.7.4). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
Error: Unexpected end of JSON input
Unexpected end of JSON input
ng update @angular/cli should not fail.
The problem seems to be that the used template has a dev-dependency on angular/cli 1.7.4 specified which is not replaced with the given instructions, so all the installing is useless and we're still using the old angular-cli version.
Not sure if this is a bug in the angular template (should angular/cli be a dev-dependency?) or a valid scenario. In any case since the dotnet template is presumably quite popular, at least in some parts of the web, mentioning this somewhere might be helpful.
For anybody else stumbling over the error message, using: npm install --save-dev @angular/cli@latest fixes the problem.
To get ng update @angular/core to work afterwards we simply have to first update the typescript compiler:
npm install --save-dev [email protected]
ng update @angular/core
The remainder of the update process goes smoothly.
@danstur thank you! For me, this error only occurred after upgrade @angular/cli from 6.0.3 to 6.0.7. All of the projects that I upgraded prior to today on earlier 6.x versions worked fine.
Also, I did not have to upgrade typescript manually to get @angular/core to upgrade - it just worked as expected. So forcing @angular/cli to @latest is the only modification I had to make to the upgrade process. However, when I went to build my project with ng build, it failed because TypeScript 2.8.3 had been automatically applied during the upgrade process. So I DID end up having to force it to 2.7.2, but for a different reason.
i have updated but not work... kindly share compelete solution
Thanks for reporting this issue. This issue is now obsolete due to changes in the recent releases. Please update to the most recent Angular CLI version.
If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior.
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
The problem seems to be that the used template has a dev-dependency on angular/cli 1.7.4 specified which is not replaced with the given instructions, so all the installing is useless and we're still using the old angular-cli version.
Not sure if this is a bug in the angular template (should angular/cli be a dev-dependency?) or a valid scenario. In any case since the dotnet template is presumably quite popular, at least in some parts of the web, mentioning this somewhere might be helpful.
For anybody else stumbling over the error message, using:
npm install --save-dev @angular/cli@latestfixes the problem.To get
ng update @angular/coreto work afterwards we simply have to first update the typescript compiler:The remainder of the update process goes smoothly.