今天因為想要嘗試一下vue-cli3版本的腳手架,於是更新了一下node版本,結果導致原來的vue項目無法成功啟動,報錯信息大概類似於
“Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 10.x”
同時,命令行提示:
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
看這個說明,大概意思就是說,因為我在執行了npm install指令安裝好了依賴之后,環境又發生了改變(node版本變更),所以不能將當前的node環境與項目中的sass依賴建立綁定關系,需要執行“npm rebuild node-sass”來重新下載依賴。
所以,按他說的,執行命令npm rebuild node-sass
一通下載之后,運行項目,依然報錯,於是開始百度,按照其他網友的指示,再執行一次npm update 來更新項目里的依賴包,然后,大功告成。