Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to override npm peerinvalid

I'm attempting to install a node module that has specified a peerDependencies to an older version of a package. I know that module will work with the newer version. How can I tell npm to ignore the peerinvalid error? Currently the peerinvalid error is stoping the installation process.

This is the error:

npm ERR! peerinvalid Peer [email protected] wants [email protected]

Thanks!

like image 255
Kyle Finley Avatar asked Nov 09 '22 17:11

Kyle Finley


1 Answers

A really hacky/temporary workaround is to modify the package.json of the installed packages with the peerDependency specified, deleting the lines that specify react as a peerDependency.

This hack will go away if you (or a colleague) need to npm install your package's requirements from scratch. Like I said, a crappy temporary workaround.

like image 166
Nick Spacek Avatar answered Nov 14 '22 21:11

Nick Spacek