Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    Set default values for package.json using npm set

    Mark ShustMark Shust

    Npm by default uses global values when initializing a new package.json file. Learn how to set your own global default values by command line or editing the ~/.npmrc file.



    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson


    Instructor: 00:00 Initializing an npm package.json file uses global defaults. Most of the time you'll want to have the same author and license for all of your projects. Let's set some defaults for us to use.

    00:13 Npm set init followed by the property you want to define. Here we will set a license, author email, and author name. Let's initialize this repo again.

    00:29 We can see that the new initialization was created from the global properties we just defined. You can also see that these values can be edited manually by opening up the hidden npmrc file from your home directory, then editing and saving the file.