P.N.Jayasinghe
P.N.Jayasinghe

Reputation: 47

How to find compatible dependency version for a given nodeJS version

Suppose I am upgrading my node version from 14 LTS to 16.18.1 LTS version. After that I need to upgrade my react project node modules to latest & compatible versions. Can anyone advice me how to find out compatible version of a node module for a given node version?

Upvotes: 1

Views: 7629

Answers (1)

Paalar
Paalar

Reputation: 265

Hope I understood you correctly. you can use the npm view <package_name> command to see more information about what is required.

If you want to know what dependencies React 17.0.1 requires you can use these commands and get these outputs

npm view [email protected] dependencies 
{ 'loose-envify': '^1.1.0', 'object-assign': '^4.1.1' }

npm view [email protected] engines
{ node: '>=0.10.0' }

Then you know you what dependency versions and node versions you require. You can do the same with npm view <package> peerDependencies

Upvotes: 9

Related Questions