Specify Node Version in package.json

Lock in the version of node your project uses

Thu, 13 Oct 2022

Sometimes you may want your application to run on a certain version of node while developing. I find this most useful to make sure all developers are using the same major version of node on the project. With this setting in your package.json it should create an error any time someone tries to run a project without the specific version

Add this project as a top level field in your package.json

  "engines": {
    "node": "8"

The above code will let the project be ran on any version of node that is 8, if it isn’t 8, the start command will throw an error

Buy Me A CoffeeDigitalOcean Referral Badge
Edward Beazer

Edward Beazer - I just like to build shit. Sometimes I get stuck for hours, even days while trying to figure out how to solve an issue or implement a new feature. Hope my tips and tutorials can save you some time.

DigitalOcean Referral Badge