Solve the problem of "npm WARN requires a peer of XXX"

    In NodeJs development, it is often necessary to install various dependent packages, and sometimes these dependent package versions are updated or changed to another package name, causing npm install to report a warning such as "requires a peer of XXX". The solution is to make up what is missing , the command is as follows:

npm install --save-dev "XXX"

    For example, the warning report "requires a peer of eslint@>=6.2.2", as shown in Figure (1):


Figure (1) The warning reports "eslint@>=0.62.2" The dependent package is missing, just install the package

    The warning indicates that the current project lacks eslint@>=6.2.2 dependent packages, just use the npm command to install, as follows:

npm install --save-dev "eslint@>=6.2.2"  

Guess you like

Origin blog.csdn.net/sanqima/article/details/109643661