• 1 min

Define NodeJS, NPM, and TypeScript version in your Package.json

Define NodeJS, NPM, and TypeScript version in your Package.json

I think this is a pretty unknown feature in the package.json. But you can define what version a computer needs to be able to run your project.

I discovered this because I did get different error’s on a Next.js project than my team members. The issue was because we were using different versions of Node & TypeScript.

Right now, I defined this in our package.json, so everyone gets a message they have other versions. This configuration reminds people to update their Node and TypeScript.

{    //.... more configuration package.json    "engines": {        "tsc": "3.7.2",        "node": "14.16.0",        "npm": "7.6.3"    }}

I hope this will help you create better applications and get fewer errors 😅


Thanks!

After reading this post, I hope you learned something new or are inspired to create something new! 🤗

If I left you with questions or something to say as a response, scroll down and type me a message. Please send me a DM on Twitter @DevByRayRay when you want to keep it private. My DM’s are always open 😁

RayRay

I’m Ray, a Frontend Developer since 2009 living in the Netherlands. I write about Frontend Development, JavaScript, TypeScript, Angular, CSS, VueJS and a lot more related topics.

Want to reach me for comments or questions on my blog? Send a DM on Twitter @DevByRayRay