當node升級後導致webpack打包出錯,node-saas出問題的解決辦法

報錯信息如下:

ERROR in ./node_modules/[email protected]@extract-text-webpack-plugin/dist/loader.js?{"omit":1,"remove":true}!D:/work/nl_web/node_modules/[email protected]@vue-style-loader!D:/work/nl_web/node_modules/[email protected]@css-loader?{"sourceMap":true}!./node_modules/[email protected]@vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-6cf3286b","scoped":true,"hasInlineConfig":false}!D:/work/nl_web/node_modules/[email protected]@sass-loader/lib/loader.js?{"sourceMap":true}!./node_modules/[email protected]@vue-loader/lib/selector.js?type=styles&index=0!./src/components/audioItem1/audioItem1.vue
Module build failed: Error: "extract-text-webpack-plugin" loader is used without the corresponding plugin, refer to https://github.com/webpack/extract-text-webpack-plugin for the usage example
    at Object.pitch (d:\work\nl_web\node_modules\[email protected]@extract-text-webpack-plugin\dist\loader.js:57:11)

解決辦法如下:

npm install -g node-gyp 
npm install --global --production windows-build-tools // 如果是windows7系統請安裝[email protected]

解釋原因:
saas是一個日本人搞得ruby語言中使用的一個預編譯器,以前使用的時候我們需要安裝ruby環境,後來gulp整合了saas也是挺好用的,
但是,node-saas就需要python環境了,所以很多人又不知道,就升級了node,導致node-saas無法使用了,
由於我使用了vue-element-admin這個架子,但自帶的是node5.6.0這個版本,當需要升級node時候,就升級了(打包速度變快了點),
結果導致node-saas出錯,本人也是搜索了很多信息,找了個種辦法,都無法解決,在一次偶然的地方遇到有人說安裝以上兩個就行了,
我就抱着試一試的態度裝了一下果然好了。

最後建議:
希望大家都使用stylus吧,安裝簡單,依賴的環境簡單,升級無壓力,代碼和寫python一樣,本着“人生苦短,我用python”這個名言,我建議別再折騰這個坑saas了!

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