Skip to content

ng update @angular/cli fails #10644

@davidkarlsen

Description

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions