1. 程式人生 > >解決Cannot read property 'range' of null 錯誤

解決Cannot read property 'range' of null 錯誤

vue工程npm run serve/start/dev啟動時,node_modules檔案報:Cannot read property 'range' of null 錯誤

改問題是"babel-eslint"版本更新問題導致的;

給大家一個最簡單粗暴的解決方案:

 在專案裡找到對應的工程:直接刪除裡面的node_modules資料夾,然後重新npm install下就可以了;

node_modules檔案內容較多,建議用cnpm install,會更快一點。 

重新install後能正常跑起來了.

 

tips:

當清node_modules 出現某一些包錯誤時候,查不到原因時候,可以先清除快取試試。

rm -rf node_modules
npm cache clean
npm install

npm cache clean // 暴力清快取:npm cache cle