DEV Community

Walter Nascimento
Walter Nascimento

Posted on

16

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

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs