Vue install sass

use sass in vue projects

 npm install --save-dev sass-loader style-loader css-loader

 rules:[
   {
        test: /\.scss$/,
        loaders: ["style", "css", "sass"]
      },
]



installation always reports an error. I don"t know how sass is installed successfully in other projects. I execute the npm command in the project directory, so please let me know how to install it.

Mar.24,2021

use cnpm to see


it is easy to go wrong when installing sass when the network is poor. Check your network speed. Try it with yarn,

yarn add node-sass sass-loader style-loader css-loader --save-dev 

  1. npm install
  2. then use cnpm install node-sass to patch node-sass
  3. if the installation fails, delete the node_modules folder and re-npm install, and then continue with the cnpm install node-sass patch node-sass

good luck


using sass requires preloading Ruby first.

Menu