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?
Asked
Active
Viewed 2,547 times
1 Answers
6
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 react@17.0.1 dependencies
{ 'loose-envify': '^1.1.0', 'object-assign': '^4.1.1' }
npm view react@17.0.1 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

Paalar
- 175
- 1
- 8
-
Hi, thanks for the clarification. This was helpful. By the way my action items are as below. I am running a react 16 project on top of node 14 LTS. Now I wanted to upgrade react to 17 or 18. My fist assumption is in order to upgrade to react 17 or 18 i have to upgrade node version to 16 or 18 LTS. Then I have to upgrade dependencies to compatible versions which maps with node version. Lets say 'axios' should updated to from 0.21.1 to 1.2.0. In the axios git hub page can I find node version which is compatible with given axios version. Like that I need to analyze all the dependencies. – P.N.Jayasinghe Nov 24 '22 at 16:55
-
Very helpful. Saved a lot of time. – invinciblemuffi Mar 01 '23 at 13:35