今天在安裝依賴包的時候老報錯,報錯如下:
npm ERR! Unexpected end of JSON input while parsing near '...Comment: https://open'
因爲我安裝過淘寶鏡像,懷疑是因此報錯,上網找答案,要執行下面這句話清除下緩存:
npm cache clean --force
然後再重新安裝一下官方的鏡像:
npm set registry https://registry.npmjs.org/
安裝完再執行 cnpm install 安裝包安裝成功,啓動項目ok了