npm WARN ... requires a peer of ... but none is installed. You must install peer dependencies yourself
"A requires a peer of B but none was installed". Consider it as "A requires one of B's peers but that peer was not installed and we're not telling you which of B's peers you need."
The automatic installation of peer dependencies was explicitly removed with npm 3.
So you cannot install peer dependencies automatically with npm 3 and upwards.
Updated Solution:
Use following for each peer dependency to install that and remove the error
npm install --save-dev xxxxx
Deprecated Solution:
You can use npm-install-peers to find and install required peer dependencies.
npm install -g npm-install-peers
npm-install-peers
If you are getting this error after updating any package's version then remove
node_modules
directory and reinstall packages bynpm install
ornpm cache clean
andnpm install
.
For each error of the form:
npm WARN {something} requires a peer of {other thing} but none is installed. You must install peer dependencies yourself.
You should:
$ npm install --save-dev "{other thing}"
Note: The quotes are needed if the {other thing}
has spaces, like in this example:
npm WARN rollup-plugin-uglify@6.0.3 requires a peer of rollup@>=0.66.0 <2 but none was installed.
Resolved with:
$ npm install --save-dev "rollup@>=0.66.0 <2"
The accepted answer of using npm-install-peers did not work, nor removing node_modules and rebuilding. The answer to run
npm install --save-dev @xxxxx/xxxxx@latest
for each one, with the xxxxx referring to the exact text in the peer warning, worked. I only had four warnings, if I had a dozen or more as in the question, it might be a good idea to script the commands.