NPM Install Error:Unexpected end of JSON input while parsing near '…nt-webpack-plugin“:”0'

前端 未结 30 2384
孤街浪徒
孤街浪徒 2020-11-22 10:20

When Creating a new Angular 5 project:

node version: 8.9.2

npm version: 5.5.1

My Command is

npm install -g @angular/cli
30条回答
  •  北恋
    北恋 (楼主)
    2020-11-22 11:13

    Just faced the issue of Unexpected end of JSON input while parsing near.. while adding the 'radium' package in my React App. As a matter of fact, I am facing this issue even when trying to update the NPM to the latest version.

    Anyways, NPM didn't work after clearing the cache and it also won't update to the latest version right now but adding the package via Yarn did the trick for me.

    So, if you are in a hurry to solve this issue but you are not able to, then give yarn a try instead of npm.

    Happy Coding!

    Update

    After trying few things finally sudo npm cache clean --force worked for me.

    This can be a temporary glitch in your network or with something else in the npm registry.

提交回复
热议问题