Vue卸載2.0 安裝4.0報錯

坑1: 卸載2.9.6 版本報錯:

error Refusing to delete C:\Users\Gavin\AppData\Roaming\npm\vue-init.cmd: is outside C:\Users\Gavin\AppData\Roaming\npm\node_modules\vue-cli and not a link

網上搜了半天沒人遇到, 這種情況我有兩種預感, 一是我的操作問題導致, 一般人遇不到這種,所以搜不到, 二是這種問題解決可能比較簡單,大家不懈分享出來.
這裏我的做法比較粗魯, 直接到npm 目錄下吧所有關於vue的全部幹掉 ,然後再卸載, 1秒鐘結束,估計不用卸載了, 然後再安裝 直接安裝到了4.0上

坑2: create 首個項目報錯

gyp ERR! configure error : …python.EXE … .%s .%s 的一個錯誤.
我本地是Python3.7的版本, 不知道是不是不兼容, 搜了半天參考這裏 https://hisk.io/how-to-fix-node-js-gyp-err-cant-find-python-executable-python-on-windows
先安裝

npm install --global --production windows-build-tools

再安裝

npm install node-gyp

ok 然後你再重新Create 你的項目

坑3: node-sass編譯報錯

提示編譯失敗: helloworld\node_modules\node-sass\build\src\libsass.vcxproj(20,3): error MSB4019: 查詢是因爲node-sass 沒安裝成功
進入到你的項目中手動安裝它

cd helloworld
cnpm install node-sass

ok 再運行

npm run serve

demo 出來了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章