天天看點

VUE 項目引入Sass後啟動報錯 TypeError [ERR_INVALID_ARG_TYPE]: The “path“ argument must be of type string 解決方法

起因 :我是用vue cli建立的項目,vue cli版本是4.4.6

vue檔案裡面使用,各種報錯,

 解決方法是:肯定要安裝sass-loader和node-sass

 結果還是老是報錯:TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string。

查老半天,各種試,結果就是版本問題

把package.json裡面node-sass和sass-loader版本改成:"node-sass": "^4.11.1","sass-loader": "^7.3.0"就可以了

删掉node_modules檔案夾,重新執行

npm install

cnpm install node-sass --save

完美解決

vue