NPM

Update npm dependencies

How to check for outdated dependencies and how to update them

Today I had to work on project that was 1 year old and a lot of the dependencies where outdated.

We can run the command npm outdated to get a list of all the dependencies that have new releases.

outdated list

We then need a way to update them all, that’s when another package called npm-check-updates comes in handy. This package will upgrade the package.json versions of all outdated dependences.

shell
1npm install -g npm-check-updates

Note: You should install this package globally so you can use on other projects.

After installing the package you need to run ncu -u on your terminal to upgrade your package.json.

updated list

Finally you can run the command npm update to update your dependencies.

Webmentions

0 Like 0 Comment

You might also like these

How to create a function to filter articles by tag. On this post I am using the javascript filter method to filter all articles.

Read More
React

How to filter all MDX articles by tags

How to filter all MDX articles by tags

How to add syntax highlighting to gatsby MDX with prism.

Read More
React

Add code highlighting to MDX

Add code highlighting to MDX

Exploration on how to run Pyscript in a React (NextJS) app, this article explores issues and solutions to run PyScript in a React app.

Read More
PyScript

How to run PyScript in React

How to run PyScript in React

A quick introduction on how to use the Elasticlurn Plugin for Gatsby together with MDX to create a search bar component and allow users to search your site.

Read More
React

How to use elasticlunr plugin with MDX

How to use elasticlunr plugin with MDX