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

前端 未结 30 1856
孤街浪徒
孤街浪徒 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:04

    Even if npm cache clean --force

    Try to execute the installing cmd in admin folder.
    i.e C:\Users\admin
    This worked out for me.

    0 讨论(0)
  • 2020-11-22 11:05

    I resolved my problem with this one liner

    npm cache clean --force
    

    It works like a charm all the time. I love one liners. Note: since its a clean install, I had no concerns emptying npm cache.

    0 讨论(0)
  • 2020-11-22 11:06

    Simple solutions:

    npm cache clean --force
    npm install 
    
    0 讨论(0)
  • 2020-11-22 11:06

    I solved that by first cleaning the cache using

    npm cache clean --force
    

    Then

    npm install -g @angular/cli
    
    0 讨论(0)
  • 2020-11-22 11:06

    Instead of clearing the cache you can set a temporary folder:

    npm install --cache /tmp/empty-cache
    

    or

    npm install --global --cache /tmp/empty-cache
    

    As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use npm cache verify instead. On the other hand, if you're debugging an issue with the installer, you can use npm install --cache /tmp/empty-cache to use a temporary cache instead of nuking the actual one.

    0 讨论(0)
  • 2020-11-22 11:07

    For me I had to clone my branch again and do npm install

    0 讨论(0)
提交回复
热议问题