I have a general way to solve this type of problems, which could be helpful too, especially when cloning repositories to run them locally, but requires a little more analysis of the versions.
With the package npm-check-updates
I verify the versions of the packages (according to the package.json file) that are not declared in their latest available versions, as shown in the figure (https://www.npmjs.com/package/npm-check-updates):
With this information we can verify the update status of the different packages and make decisions as to which packages to upgrade / degrade and which ones do not.
Assuming that we decided to update all the packages as they are listed, we can use the ncu -u
command which only modifies your package.json file. Run npm install
to update your installed packages and package-lock.json.
Then, depending on the requirements of the repository, we can refine what is needed, installing the specific versions with
npm view <package> versions
and npm install <package>@<version>