Paige Niedringhaus
1 min readApr 13, 2021

--

Hi Nazario!

Glad to hear you avoided catastrophe.

To answer your question of when to use one versus the other, I might suggest: why not use both?

The only drawback (I believe) to `.nvmrc` is that a user must already have NVM installed on their local machine for the `.nvmrc` file to take effect.

So if there's a dev who doesn't have NVM downloaded for whatever reason `@engines` can be the fallback to ensure a compatible version of Node, NPM or Yarn is being used when the project starts up. Because every JS project will most definitely have a `package.json` file - there's no getting around that one.

Personally, my team also uses the `@engines` in the `package.json` to discourage devs from using Yarn to install as well (it looks like this).

``` json

"engines": {

"yarn": "NO LONGER USED - Please use npm",

"node": "^10.13.0"

},

```

I hope this helps.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Paige Niedringhaus
Paige Niedringhaus

Written by Paige Niedringhaus

Staff Software Engineer at Blues, previously a digital marketer. Technical writer & speaker. Co-host of Front-end Fire & LogRocket podcasts

No responses yet

Write a response