這兩天執行 npm install 時會報錯誤:
npm ERR! Unexpected end of JSON input while parsing near
這個錯誤的解決方法有以下幾種:
1.刪掉package.lock.json
2.清除cache
npm cache clean --force
3.進入下面這個文件夾清除cache
路徑:C:UsersPCAppDataRoamingnpm-cache
執行:
npm cache clean --force
4.不要用淘寶鏡像。
npm set registry https://registry.npmjs.org/
