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

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

Dev By RayRay
Β·Mar 19, 2021Β·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

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 πŸ˜…


hashnode-footer.png I hope you learned something new or are inspired to create something new after reading this story! πŸ€— If so, consider subscribing via email (scroll to the top of this page) or follow me here on Hashnode.

Did you know that you can create a Developer blog like this one, yourself? It's entirely for free. πŸ‘πŸ’°πŸŽ‰πŸ₯³πŸ”₯

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 😁

Share this


I learn by writing, and write while learning more and more each day!πŸ‘Š A developer is never finished with learning, thinking that is the most stupid thing to do 🀣