Problem description

Eslint and eslint-Loader versions do not match.

Cause analysis,

I tried to update one of them to the specified version to make them match. The same error is reported when updating, but the conflicting modules are different. For example, webpack and extract-text-webpack-plugin do not match. So it’s not just a module problem. It should be a Node problem. Then I thought I had just upgraded Node, and I was pretty sure it was node.

The solution

There are a lot of posts about this error, and their reason for the error is to upgrade too high (higher than the latest stable version) of Node, and their solution is to downgrade Node to the latest stable version. I don’t think I should, because I’m in the stable version now, and the stable version has so many errors that it doesn’t make sense, so maybe it’s not node. The real problem was that the Node version didn’t match the NPM version, and my NPM had been upgraded before. The latest version was installed with the following code

$ npm i -g npm
Copy the code

However, we can check the following link and find that the NPM version corresponding to the latest stable version of Node is not my latest upgrade. Nodejs.org/zh-cn/downl… This locks down the real problem, and the solution is to install the specified version of NPM.

$ npm i -g npm@6.1417.
Copy the code