Angular-cli: error Unexpected end of JSON input while parsing near

Created on 28 Sep 2017  路  4Comments  路  Source: angular/angular-cli

Bug logs

1838 silly resolveWithNewModule [email protected] checking installable status
1839 http fetch GET 200 https://registry.npmjs.org/micromatch 836195ms
1840 silly fetchPackageMetaData error for micromatch@^2.1.5 Unexpected end of JSON input while parsing near '..."^2.0.1","kind-of":"^'
1841 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '..."^2.0.1","kind-of":"^'
1841 verbose stack     at JSON.parse (<anonymous>)
1841 verbose stack     at parseJson (/usr/lib/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)
1841 verbose stack     at consumeBody.call.then.buffer (/usr/lib/node_modules/npm/node_modules/pacote/node_modules/make-fetch-happen/node_modules/node-fetch-npm/src/body.js:96:50)
1841 verbose stack     at <anonymous>
1841 verbose stack     at process._tickCallback (internal/process/next_tick.js:188:7)
1842 verbose cwd /
1843 verbose Linux 3.10.0-514.el7.x86_64
1844 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" "-g" "angular-cli"
1845 verbose node v8.6.0
1846 verbose npm  v5.4.2
1847 error Unexpected end of JSON input while parsing near '..."^2.0.1","kind-of":"^'
1848 verbose exit [ 1, true ]

Versions.


node v8.6.0
npm v5.4.2

Repro steps.


The error occurred when I run npm install -g angular-cli

Most helpful comment

If you are using windows, these may solve your issue,

  • Delete temp files on OS level (temp in run)

  • Delete temp files on Application level(%temp% in run)

All 4 comments

This seems like a problem with your node/npm and not with Angular CLI.

Please have a look at the common errors page, npm issue tracker, or open a new issue if the problem you are experiencing isn't known.

If you are using windows, these may solve your issue,

  • Delete temp files on OS level (temp in run)

  • Delete temp files on Application level(%temp% in run)

Thanks @vivekodela ...this solved my issue

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._

Was this page helpful?
0 / 5 - 0 ratings