npm install 出現Unexpected end of JSON input while parsing near '...hment":false,"

今天拿vue-cli構建vue項目,在npm install依賴包的時候出現了Unexpected end of JSON input while parsing near '...hment":false,"tarball'的錯誤,因而上網搜查了一下,有說是因爲淘寶鏡像的緣由,因而我就把倉庫地址設爲https://cnpmjs..org,再進行npm的時候,因爲網速太慢,install了半天沒反應。html

只有另尋他法,在該網址:http://xxd3vin.github.io/2017/09/26/npm-unexpected-end-of-json-input-while-parsing-near.html發現也出現了一樣的錯誤,只用了一個命令,npm cache clean --force 。因而將倉庫地址從新換成淘寶鏡像,使用該命令:npm config set registry https://registry.npm.taobao.org;而後在清除緩存npm cache clean --force。最後竟然成功了vue

相關文章
相關標籤/搜索