跟往常一樣運行npm install 的時候,突然報錯。錯誤情況如下:
npm ERR! Cannot read property 'match' of undefined npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\user\AppData\Roaming\npm-cache\_logs\2018-08-06T01_49_46_486Z-debug.log
查找了很多的方法,有人說清楚npm本地緩存(npm cache clear --force),我都試過了,還是報錯。。
最后刪了項目文件夾下面的package-lock.json,然后再運行npm install便可正常的安裝了~~~
如果還是不行的話,那就一條條執行下面這四條命令吧~~~
1 rm -rf node_modules 2 rm package-lock.json 3 npm cache clear --force 4 npm install
