Home > Article > Web Front-end > What does node-sass do?
"node-sass" is a library used to bind "node.js" into LibSass; LibSass is a C version of the popular stylesheet preprocessor sass. "node-sass" allows users to ".scss" files are compiled natively to css and can be automatically compiled by connecting middleware.
The operating environment of this article: Windows 10 system, nodejs version 16, Dell G3 computer.
Node-sass is a library that binds Node.js to LibSass (the C version of the popular stylesheet preprocessor Sass). It allows users to compile .scss files to css natively at incredible speeds, with automatic compilation via connecting middleware.
What is Sass?
Sass is a preprocessor scripting language that can be interpreted or compiled into Cascading Style Sheets (CSS).
How to install node-sass?
In view of the domestic environment, node-sass is too difficult to install. It can be installed directly through Taobao’s npm image.
Install node-sass in the project folder
npm install -g cnpm --registry=https://registry.npm.taobao.org cnpm install --save-dev node-sass
Instructions: –save-dev automatically adds node-sass to package.json in the project folder.
Extended knowledge
Summary of problems during installation
Two steps to solve the Node Sass version 7.0.0 is incompatible with 4.0.0 error using create -react-app Build front-end project
If you want to use sass, install npm install node-sass --save
Error when starting the service:
Node Sass version 7.0.1 is incompatible with ^4.0.0
See the error is caused by incompatibility
npm uninstall node-sass npm i -D sass
Recommended study: "nodejs video tutorial"
The above is the detailed content of What does node-sass do?. For more information, please follow other related articles on the PHP Chinese website!