Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to update warn deprecated

I'm trying to learn node and npm, using express for a little project. When i install it, i got

npm WARN deprecated [email protected]: core-js@<3.0 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.

I understood that if everything works, it's not necessary to update everything, but i'm trying to learn and go the extra, unnecessary, mile.

How can i update only core-js?

npm install core-js@^3

will update it adding it to the dependencies in package.json.

Is this the right way to do it? Or it's better to update the parent package that use it? If so, how can i understand which is the package that need an update and how to update it? Or is there a way to update only the modules listed in package-lock.json.

Thanks.

like image 761
vitta Avatar asked Sep 17 '25 20:09

vitta


1 Answers

You provided one way to update a package. However, there are a few more.

To update a global package, you could run:

npm update -g <package_name>

To update a package that's in your package.json (i.e., local to your project), run:

npm update <package_name>

You could also see what outdated package are there as follows:

npm outdated

You could again add -g option to check outdated global packages.

Sources: https://docs.npmjs.com/updating-packages-downloaded-from-the-registry

Also: man npm may help (in Linux).

like image 159
oneturkmen Avatar answered Sep 19 '25 13:09

oneturkmen