Reputation: 1643
I want to install dependencies with specific version while installing one module.
Let's say I want to install react-virtualized-select module. It has a dependency on react-virtualized module. So when I run 'npm install react-virtualized-select', It installs latest version(9.11.0) of 'react-virtualized' module. But I want to install specific version (9.9.0) of 'react-virtualized' module.
I tried doing below in package.json
"peerDependencies": {
"react-virtualized-select/react-virtualized": "9.9.0"
},
but shows below message.
+-- [email protected]
`-- UNMET PEER DEPENDENCY react-virtualized-select/[email protected]
Upvotes: 0
Views: 4278
Reputation: 328
You can try this way!
Syntax,
npm i packageName@versionNumber
For example,
npm i [email protected]
Upvotes: 1
Reputation: 345
Maybe you can share why you want another version of a dependency.
A module controls dependencies through its package.json. It knows which version it depends on and installs that version. Overriding that dependency may give you unwanted results. If you want another version installed, you can add that in your package json.
react-virtualized-select: '^9.11.0',
react-virtualized: '<version>'
Upvotes: 0