Keeping your Javascript Project Updated - 2025 Edition
How to keep your Javascript (or Typescript) project up to date - the 2025 edition.
Mar 11, 2025
Sunny GolovineThis is an update to an article I wrote in 2021 on the same topic.
Javascript (and Typescript) projects tend to “rot” pretty quickly, pickup a project from just a few years ago and try running it and I promise you won’t have the best results. Here are a few simple tricks I use on my projects to help me keep packages updated and prevent code rot.
Keeping Packages Updated
For keeping packages updated, I recommend npm-check-updates. You can install this as a dependency or run it via npx
or another tool like: npx npm-check-updates
.
There are several ways of running this library but I recommend running it in “interactive” mode, done by passing the --interactive
flag (ie. npx npm-check-updates --interactive
). This will give you an interactive prompt to either select all updates or pick them one by one. After confirming your selection, the tool will ask if you want to install dependencies or just leave your package.json alone and let you run the corresponding install command (ie. npm i
).
Automating Package Upgrades
If you prefer to have your packages upgraded automatically (or semi-automatically), you can leverage either Dependabot or Renovatebot. Once setup, each will scan your repository for outdated dependencies and will automatically open pull requests to update these packages.
While these are good options, because package upgrades often require manual testing to validate nothing broke, I personally do not find value in setting up automated dependency upgrades.
Other Tricks
-
Use Node Version Manager: I highly recommend anyone working on a NodeJS project use Node Version Manager. Once you have it installed you can create an
.nvmrc
file in the root of your project with your specified version inside. Once you have this, you can quickly use/install the correct Node version by doing:nvm use
ornvm install
-
Use Yarn Policies: If you use Yarn on your project, you can set a “policy” to a specific Yarn version. This means that a developer may come into the project with an entirely different version of Yarn but when they run
yarn install
, the correct version of Yarn will automatically be used.