npm install eslint version error

For the project generated by vue cli, eslint is checked for the component, and an error is reported when the project npm install is run, and the installation package dependency fails. The source of the error is that the node version does not correspond to the npm version

Screenshot of error message:

Versions before npmV7 encounter dependency conflicts and will ignore dependency conflicts and continue to install

The npmV7 version will not be automatically ignored, and the user needs to manually enter the command

There are two commands to fix this

  • One is --force ignores conflicts and forces access to remote npm library resources (before overwriting)

npm install  --force

  • The second is --legacy-peer-deps Ignore dependency conflicts and continue to install (do not overwrite before)

npm install --legacy-peer-deps

The above two methods are simple and easy to understand, but the symptoms are not the root cause. The important thing is to reduce the npm version

Query the node version (node ​​-v), the computer node version is 16.19.1

Query the npm version (npm -v), the computer npm version is 8.19.3

Correspondence between node and npm versions

Downgrade the npm version

npm install [email protected] -g --force

Execute npm install, error resolution

Guess you like

Origin blog.csdn.net/weixin_44220970/article/details/130308017