Web front-end_Vue framework_A solution to Can't resolve 'sass-loader' in... error

Because it needs to be used in the Vue2+element UI (not recommended to go to the Element UI official website) project <style lang="scss">, I found that it will report an error every time, and it is quite messy to find some solutions on the Internet. The following is one of the problems I encountered. A solution:

Error in Chrome browser:

write picture description here
It just can't parse sass-loader .
So the first step needs to be introduced in the project:

  npm install sass-loader -D
  npm install node-sass -D

The first one was quickly introduced successfully:
write picture description here
but the second one made an error:
write picture description here
but I used it again cnpm install node-sass -Dand it was successful! ! ! (It's slag now, and I don't know why)
write picture description here
So the project can run successfully:
write picture description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324834682&siteId=291194637