Repository navigation
ng update @angular/cli fails #10644
Copy link
Copy link
Closed
Description
ng update @angular/cli
Updating karma configuration
Updating configuration
Removing old config file (.angular-cli.json)
Writing config file (angular.json)
Some configuration options have been changed, please make sure to update any npm scripts which you may have modified.
DELETE .angular-cli.json
CREATE angular.json (4068 bytes)
UPDATE karma.conf.js (1848 bytes)
UPDATE package.json (4947 bytes)
UPDATE tslint.json (2637 bytes)
error An unexpected error occurred: "/Users/et2448/projects/tac/jfr/tac-jfr-js-client/package.json: Unexpected string in JSON at position 4756".
Package install failed, see above.
Versions
ng --version
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 6.0.0
Node: 9.11.1
OS: darwin x64
Angular: 6.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, http, language-service, material, platform-browser
... platform-browser-dynamic, platform-server, router
Package Version
------------------------------------------------------
@angular-devkit/architect 0.6.0
@angular-devkit/core 0.6.0
@angular-devkit/schematics 0.6.0
@angular/flex-layout 6.0.0-beta.15
@schematics/angular 0.6.0
@schematics/update 0.6.0
rxjs 6.1.0
typescript 2.7.2
node --version
v9.11.1
Repro steps
- Step 1
- Step 2
- Step 3
Observed behavior
ng update @angular/cli
Updating karma configuration
Updating configuration
Removing old config file (.angular-cli.json)
Writing config file (angular.json)
Some configuration options have been changed, please make sure to update any npm scripts which you may have modified.
DELETE .angular-cli.json
CREATE angular.json (4068 bytes)
UPDATE karma.conf.js (1848 bytes)
UPDATE package.json (4947 bytes)
UPDATE tslint.json (2637 bytes)
error An unexpected error occurred: "/Users/et2448/projects/tac/jfr/tac-jfr-js-client/package.json: Unexpected string in JSON at position 4756".
Package install failed, see above.
Note that it generates wrong json syntax in the migration step:
git diff package.json
diff --git a/package.json b/package.json
index 4183866..f499466 100644
--- a/package.json
+++ b/package.json
@@ -96,8 +96,9 @@
"ts-node": "4.1.0",
"tslint": "^5.10.0",
"tslint-sonarts": "^1.6.0",
- "typescript": "~2.7.2"
- },
+ "typescript": "~2.7.2," <-- comma inside hyphen, not after
+ "@angular-devkit/build-angular": "~0.6.0"
+ },
"_doc": "need to force consistent version due to transitive dep from ngx-configure:",
"resolutions": {
"@angular/core": "6.0.0"
Desired behavior
ng update should proceed and update package.json and generate my
angular.json file etc
Reactions are currently unavailable
Activity
malinges commentedon May 7, 2018
Same issue here, also on OS X.
After
ng update @angular/cli, package.json ends up like this:I already noticed this two-character offset on angular 5.2 with
ngcommands likeng g.Might be a schematics-related issue...?
fix(@angular-devkit/schematics): add support for BOM to UpdateRecorder
fix(@angular-devkit/schematics): add support for BOM to UpdateRecorder
fix(@angular-devkit/schematics): add support for BOM to UpdateRecorder
fix(@angular-devkit/schematics): add support for BOM to UpdateRecorder
fix(@angular-devkit/schematics): add support for BOM to UpdateRecorder
davidkarlsen commentedon May 13, 2018
I see this is fixed, how should I proceed? Trying cli 6.0.1 it still fails:
davidkarlsen commentedon May 16, 2018
@hansl - see comment above. I don't have any files with BOM.
Kiyozz commentedon May 22, 2018
This issue still happening with @angular/cli 6.0.3
DarthPinguin commentedon May 24, 2018
My tslint.json was empty, i added '{}' to have a valid json, ng update succeded after.
JigneshPatel04 commentedon May 29, 2018
same issue
when I run ng update @angular/cli
Updating karma configuration
Updating configuration
Removing old config file (.angular-cli.json)
Writing config file (angular.json)
Invalid JSON character: "" at 0:0.
shanemac10 commentedon Jun 5, 2018
I am following the steps to update from 5.2 to 6 on update.angular.io and ran into
a similar issue with ng update @angular/cli
I wound up manually updating my package.json to cli version to my current version, saved it, ran npm install then ran ng update @angular/core (which is listed a few steps ahead of ng update @angular/cli on the website). During the the update core install I got this message...
... so I re-ran ng update @angular/cli and so far so good.
Hope this helps!
fix(@angular-devkit/schematics): add support for BOM to UpdateRecorder
angular-automatic-lock-bot commentedon Sep 8, 2019
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.