VUE on pit

NPM install less less-loader –save-dev error

Version of the problem, but warm tips: if the error has been reported, do not always install download, because the computer will halo! And then they changed it, and they changed it, and they got more desperate. At this point, congratulations, reinstall NodeJS without wasting too much time.

npm ERR! code ERESOLVE npm ERR! ERESOLVE Unable to Resolve Dependency tree: Figure:

Ps: I’m only reporting an error for the less-loader install, but not for the others. For example, if I type something else, I can do it

npm install axios --save
Copy the code

cause

1. Webpack is not installed

2, version problem: nPM7.x version is more strict than NPM6.x, I started with 7.x, then 6.x is ok

The solution

1, install webPack, where

webpack -v
Copy the code

When the following occurs,

Don’t keep saying yes, just type the command

npm install webpack-cli -g
Copy the code

That’s it. Now go ahead and try the previous command

I saw the following code added to webpack.base.conf.js on the Internet, but I didn’t use it.

// { // test: /\.less$/, // loader: "style-loader! css-loader! less-loader" // }Copy the code
56 packages are looking for funding run npm fund for details

This is because the less-loader version is too high

This will appear if run:

NPM install [email protected] - save - devCopy the code

If successful, the version information of less and less-loader is available in package.json

Conclusion:

1. Run the NPM install less less-loader –save-dev command

2. An error occurs when installing less-Loader. The NPM version or less-Loader version may be incorrect.