"node-sass" is a library used to bind "node.js" into LibSass; LibSass is the C version of the popular stylesheet preprocessor sass, and "node-sass" allows users to localize ".scss" files Compiled 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 under the project folder
npm install -g cnpm --registry=https://registry.npm.taobao.orgcnpm install --save-dev node-sassNote: –save-dev automatically adds node-sass to package.json in the project folder.
Expand knowledge
Summary of problems encountered during installation
Two steps to solve the Node Sass version 7.0.0 is incompatible with 4.0.0 error. Use create-react-app to build the front-end project.
If you want to use sass, install npm install node-sass --save
Error when starting service:
Node Sass version 7.0.1 is incompatible with ^4.0.0
It seems that the error is caused by incompatibility
npm uninstall node-sassnpm i -D sassRecommended learning: "nodejs video tutorial"
The above is the detailed content of what node-sass does. For more information, please pay attention to other related articles on this site!