DEV Community

rosa-rzi
rosa-rzi

Posted on

How to manage node versions across projects

If you're currently utilizing Docker container projects, there's no need to worry about your existing Node version. But that’s another different topic from this one that I’ll probably share with you in the future. For now, I'd like to share my story with using nvm across all my Node.js projects on my macOS system.

Note: If you have a pre-existing Node.js version on your machine, it will remain accessible as the default version. This allows you to continue using and installing nvm.

1) Get nvm installed in your macOS terminal console

Option 1:

brew install nvm

Option 2:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash

Option 3:

wget -q0- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh | bash

2) Indicated nodejs version required in my project folder in a git-tracked .nvmrc file:

echo v18.14.1 > .nvmrc

install it

npm install v18.14.1

3) This does not take effect automatically on cd, the user must do it:

nvm use

Now you can see all the node versions you have installed with

nvm list

.nvmrc is documented at: https://github.com/creationix/nvm/tree/02997b0753f66c9790c6016ed022ed2072c22603#nvmrc

Sentry blog image

How to reduce TTFB

In the past few years in the web dev world, we’ve seen a significant push towards rendering our websites on the server. Doing so is better for SEO and performs better on low-powered devices, but one thing we had to sacrifice is TTFB.

In this article, we’ll see how we can identify what makes our TTFB high so we can fix it.

Read more

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay