Reputation: 3173
I recently upgraded Angular CLI to 7.2.1. After upgrade I realized that while creating a new project using
ng new hello-ng-world
The command fails with following error.
npm WARN deprecated [email protected]: CircularJSON is in maintenance only, flatted is its successor.
npm ERR! Unexpected end of JSON input while parsing near '...ource-map":"0.1.x"},"'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\XXX\AppData\Roaming\npm-cache\_logs\2019-01-15T04_01_29_782Z-debug.log
Package install failed, see above.
I checked the log file and found following lines
2298 silly fetchPackageMetaData error for [email protected] Unexpected end of JSON input while parsing near '...","webpack-cli":"^2.0'
....
2316 silly fetchPackageMetaData error for [email protected] Unexpected end of JSON input while parsing near '...82V3Kq5OEdhCZQ8nOUUQ/'
2352 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...ource-map":"0.1.x"},"'
2352 verbose stack at JSON.parse (<anonymous>)
2352 verbose stack at parseJson (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\node_modules\json-parse-better-errors\index.js:7:17)
Not able to proceed with the project creation. Please suggest what can be done.
Edit 1: Ng version details (ng --version)
Angular CLI: 7.2.1
Node: 8.11.1
OS: win32 x64
Angular:
...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.12.1
@angular-devkit/core 7.2.1
@angular-devkit/schematics 7.2.1
@schematics/angular 7.2.1
@schematics/update 0.12.1
rxjs 6.3.3
typescript 3.2.2
Upvotes: 3
Views: 1885
Reputation: 3173
I had to force cache clean to make it work. I used the following command.
npm cache clean --force
Upvotes: 3