Node-sass version incompatibility problem (solved)
It is estimated that many friends have encountered the problem of node-sass version incompatibility. Today I will share with you how to locate the problem, how to find and be compatible with the nod-sass version in your project!
Article Directory
Tips: You may get the following error report, then look down
Syntax Error: Error: Node Sass version 7.0.1 is incompatible with ^4.0.0.
Step 1: Check your node version
// 输入命名行 查看当前项目node版本
node -v
***As shown in the picture below: My current version here is v16.15.0
Step 2: View the corresponding version output of node-sass on npm
1. Portal of the old rules [View node-sass version]
2. Check the corresponding version of your project on the official website
3. My local node version is 16.15.0, so I need to install node-sass version 6.0+;
Step 3: Delete the installed node-sass version in the project
1. First uninstall the previously installed node-sass version plugin in the local project
// 删除命令行
npm i -D sass
// 或者
npm uninstall node-sass -D
Step 4: Install the specified version and restart the project
1. How to install the specified version and start the project
// 指定版本安装
npm install node-sass@6.0.0 --save-dev
// 项目运行
npm run serve
Have you learned such a simple coquettish operation?
Summarize:
On the road to the front | I know very little, but I am good at learning.
If you have any questions, please leave a message to discuss.
— Follow me: Don’t get lost on the front end —