npm install时出现Unexpected end of JSON input while parsing near '...H/ORkS/nv8mgphiIJ\nLJ'

错误信息:

......

2127 verbose stack SyntaxError: Unexpected end of JSON input while parsing near '...H/ORkS/nv8mgphiIJ\nLJ'
2127 verbose stack     at JSON.parse ()
2127 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)
2127 verbose stack     at consumeBody.call.then.buffer (C:\Program Files\nodejs\node_modules\npm\node_modules\pacote\node_modules\make-fetch-happen\node_modules\node-fetch-npm\src\body.js:96:50)
2127 verbose stack     at
2127 verbose stack     at process._tickCallback (internal/process/next_tick.js:188:7)
2128 verbose cwd D:\angular
2129 verbose Windows_NT 10.0.16299
2130 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
2131 verbose node v8.11.3
2132 verbose npm  v5.6.0
2133 error Unexpected end of JSON input while parsing near '...H/ORkS/nv8mgphiIJ\nLJ'
2134 verbose exit [ 1, true ]
 

解决办法:

npm cache clean --force

 

你可能感兴趣的:(Angular)