DEV Community

Walter Nascimento
Walter Nascimento

Posted on

Specify Node Version in package.json

Have you ever downloaded a project that uses javascript and wondered what version of npm or node you need to run?

Or did you need to inform the node version and didn't know where to put it?

There is a very simple and easy solution for this.

Example

Open your package.json, add the "engines" field and specify the node version.

You can enter the version directly:

{
  "engines": {
    "node": "16"
  }
}
Enter fullscreen mode Exit fullscreen mode

And you can use semver to include specific ranges or version limits:

{
  "engines": {
    "node": ">=17.0.0 <18.0.0"
  }
}
Enter fullscreen mode Exit fullscreen mode

Thanks for reading!

If you have any questions, complaints or tips, you can leave them here in the comments. I will be happy to answer!

😊😊 See you later! 😊😊


Support Me

Youtube - WalterNascimentoBarroso
Github - WalterNascimentoBarroso
Codepen - WalterNascimentoBarroso

Top comments (0)