Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8613671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:56:22+00:00 2026-06-12T04:56:22+00:00

Checking in node_module was the community standard but now we also have an option

  • 0

Checking in node_module was the community standard but now we also have an option to use shrinkwrap. The latter makes more sense to me but there is always the chance that someone did “force publish” and introduced a bug. Are there any additional drawbacks?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:56:23+00:00Added an answer on June 12, 2026 at 4:56 am

    My favorite post/philosophy on this subject goes all the way back (a long time in node.js land) to 2011:

    https://web.archive.org/web/20150116024411/http://www.futurealoof.com/posts/nodemodules-in-git.html

    To quote directly:

    If you have an application, that you deploy, check in all your dependencies in to node_modules. If you use npm do deploy, only define bundleDependencies for those modules. If you have dependencies that need to be compiled you should still check in the code and just run $ npm rebuild on deploy.

    Everyone I’ve told this too tells me I’m an idiot and then a few weeks later tells me I was right and checking node_modules in to git has been a blessing to deployment and development. It’s objectively better, but here are some of the questions/complaints I seem to get.

    I think this is still the best advice.

    The force-publish scenario is rare and npm shrinkwrap would probably work for most people. But if you’re deploying to a production environment, nothing gives you the peace-of-mind like checking in the entire node_modules directory.

    Alternately, if you really, really don’t want to check in the node_modules directory but want a better guarantee there hasn’t been a forced push, I’d follow the advice in npm help shrinkwrap:

    If you want to avoid any risk that a byzantine author replaces a package you’re using with code that breaks your application, you could modify the shrinkwrap file to use git URL references rather than version numbers so that npm always fetches all packages from git.

    Of course, someone could run a weird git rebase or something and modify a git commit hash… but now we’re just getting crazy.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just checking my JS and I have an error, but I cannot see where.
When checking for nulls I use this: String str; if(str == null){ //... }
While checking whether an object is nil, someone use 1: if (object == nil)
I have an SFINAE test for checking if an class has a function. The
I have a slight algorithmic problem. I think I miss something but can't exactly
I want to use some features for server-side javascript. I think prototype is checking
Sometimes checking of arguments in Python is necessary. e.g. I have a function which
How would I go about checking if a FILE is a directory? I have
I'm trying to install the Now.js module for Node.js. It gets installed, but it
Checking to see if __name__ == '__main__' is a common idiom to run some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.