Add 'npm install --compat <pkg>' command for auto-install a version of a <pkg> that is compatible with all other versions of packages in package.json #515
Unanswered
TetianaNazarova
asked this question in
General
Replies: 1 comment 3 replies
-
That’s what automatically happens if peerDependencies are defined correctly by every package that needs them. If they’re not, how would npm know what’s compatible? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Could you, please, consider the possibility of adding a 'npm install --compat package' or 'npm compat package' command for automatic installation in package.json a package with a version which is compatible with all other packages versions in package.json?
In my practice I had a lot of events when I had to add a new package to package.json (or update - increase or decrease the version of the already installed package) and then I got a lot of errors which were caused by the incompatibility of versions of this package with other packages in package.json.
And I had to spent a lot of time (from several minutes to several hours or even days) for struggling with that problem - I had to select a needed version of the package manually, iterating over versions pointed at https://www.npmjs.com/ and guided by intuition, luck and approximately the same release time of this package and other main packages in package.json. And if there is not 1 but several incompatibilities with several other packages it becomes a real pain.
If there is impossible to install a package with the existing versions of other packages in package.json maybe there should be an output with the instructions which packages should have to change their versions and what exactly versions should be installed for each of them and what version of new added (or with changed version) package will be compatible with them all.
If the cause of this problem is an old / new npm or node.js version - maybe there should be an output with the instructions what version of npm and / or node.js should be installed for a proper work.
Is there a possibility to automate this process in a some way? Or it isn't possible at all?
I know, that many developers had faced with a such problem - there are a lot of GitHub issues and StackOverflow questions connected to this problem in a great variations relating to a great number of different packages (libraries).
I guess that this feature will greatly facilitate and relief the development process for almost each developer using Node.js and NPM.
Beta Was this translation helpful? Give feedback.
All reactions