Not long after, the <style scoped lang="less"> sentence I copied in the code killed me again. I didn't find the words "less-loader": "^XXX" in package.json, good guy I didn't pretend. Sure enough, all the solutions I found on the Internet told me to pretend
- npm install less less-loader --save-dev =>ERESOLVE could not resolve
- npm install less --save-dev =>ERESOLVE could not resolve, pro-test not work
- npm install less --save-dev -force =>ERESOLVE overriding peer dependency, it still doesn't work once running
None of the above will work. The Internet said that there is a version problem and asked me to lower the version of less-loader
Figure 1: Failed to resolve loader:less-loader error reported when running npm run serve
Start to solve the version problem:
- npm install [email protected] [email protected] --save-dev =>ERESOLVE could not resolve, pro-test can not
- npm install [email protected] [email protected] --save-dev --force =>!!!! It works
Figure 2: The closest thing to a solution: downgrading the version
Figure 3: --force turns the tide
Figure 4: Running successfully