npm install -g cnpm --registry=https://registry.npm.taobao.orgcss
安裝上cnpm後,可使用:vue
cnpm install node-sass --save-devnode
也能夠不安裝cnpm,直接使用鏡像安裝:linux
npm install node-sass --save-dev --registry=https://registry.npm.taobao.orgwebpack
若是是linux系統,前面能夠加上sudo,web
這樣就能夠的安裝成功了,並且編譯sass也不報錯了,作個筆記記錄下。npm
最後付上webpack.config.js中vue-load的基本配置:sass
1 var path = require('path'); 2 3 module.exports = { 4 entry: path.resolve(__dirname, 'main.js'), 5 output: { 6 path: path.resolve(__dirname, 'build'), 7 filename: 'build.js' 8 }, 9 module:{ 10 loaders:[{ test:/\.vue$/,loader:'vue'}, 11 { test:/\.js$/, loader:'babel',exclude:/node_modules/}, 12 {test: /\.css$/, loader: "style-loader!css-loader"}, 13 { test: /\.(scss|sass)$/, loader: 'style-loader!css-loader!sass-loader'}] 14 }, 15 vue:{ 16 loaders:{ 17 js:'babel' 18 } 19 }, 20 babel:{ 21 presets: ['es2015','stage-0'], 22 plugins: ['transform-runtime'] 23 } 24 }