NPM Install Error:Unexpected end of JSON input whi

2019-01-06 16:10发布

Create new Angular 5 project:

node version : 8.9.2

npm version : 5.5.1

My Command is 'npm install -g @angular/cli'

the Error is

npm ERR! Unexpected end of JSON input while parsing near '...nt-webpack-plugin":"0'

npm ERR! A complete log of this run can be found in: C:\Users\Aashitec\AppData\Roaming\npm-cache_logs\2017-12-06T13_10_10_729Z-debug.log

the error log is http://www.aashitechno.in/2017-12-06T13_10_10_729Z-debug.log

11条回答
唯我独甜
2楼-- · 2019-01-06 16:31

npm cache clean --force worked for me

Error Resolved :

$ npm install -g gulp npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5 npm ERR! Unexpected end of JSON input while parsing near '.../RGs88STtAtiMP3tCiNdU'

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\admin\AppData\Roaming\npm-cache_logs\2018-11-20T07_38_56_733Z-debug.log

查看更多
淡お忘
3楼-- · 2019-01-06 16:32

this solved it npm cache clean --force

查看更多
Emotional °昔
4楼-- · 2019-01-06 16:35

If

npm cache clean --force

doesn't work try

npm cache clean --force
npm update
查看更多
戒情不戒烟
5楼-- · 2019-01-06 16:38

It's error from your npm....

So unistall node and install it again.

It works....

PS: After installing node again, install angular cli globally.

npm install -g @angular/cli@latest
查看更多
做个烂人
6楼-- · 2019-01-06 16:39
npm cache clean --force

then

npm install -g @angular/cli

worked for me

查看更多
7楼-- · 2019-01-06 16:42

Npm uses Cache for downloading new packages for you. You need to clear your npm cache. use following command to clean :

npm cache clean --force

then normally use your npm install command e.g.

npm install -g @angular/cli
查看更多
登录 后发表回答