運行react項目時報錯
caniuse-lite is outdated. please run next command
然后你運行了他給的npm update……還是不行,
在網上找了這個方法,可行:
Solution:
- Close Visual Studio
- Head to
C:\Users\USERNAME\AppData\Local\Temp\WebCompilerX.X.X
(X is the version of WebCompiler) - Delete following folders from
node_modules
folder :caniuse-lite
andbrowserslist
- Open up CMD (inside
C:\Users\USERNAME\AppData\Local\Temp\WebCompilerX.X.X
) and run:npm i caniuse-lite browserslist
- Done!
就是去你的node_modules
下刪除caniuse-lite
和browserslist兩個文件夾,記住這個文件夾,
再執行npm命令重新安裝,如果沒安裝到上面這個文件夾下,那么就復制一份過去,
原文在這里,