1. 程式人生 > >vue-cli create project時出現“Unexpected end of JSON input while parsing”解決方法

vue-cli create project時出現“Unexpected end of JSON input while parsing”解決方法

今天準備用vue-cli create project時提醒node要8.9up,於是就更新一波,順帶騷操作連npm也更到了6

一切準備完畢後就create project,進度到七八十就就報了個錯“ Unexpected end of JSON input while parsing 。。。。。。”

網上搜的什麼npm clean --force 都不管用,於是乎想是不是npm版本過高,於是降到npm5,還是不行,在網上折騰了一兩個小時候看見有人說react官網強烈建議用npm4(不知道是否有關聯,但還是試一下),果斷降到4試了一下,用 vue create project就不報錯了

降級:

npm i [email protected] -g