Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h2>Second Update</h2> <p>The FAQ is not available anymore.</p> <p>From the documentation of <a href="https://docs.npmjs.com/cli/shrinkwrap"><code>shrinkwrap</code></a>:</p> <blockquote> <p>If you wish to lock down the specific bytes included in a package, for example to have 100% confidence in being able to reproduce a deployment or build, then you ought to check your dependencies into source control, or pursue some other mechanism that can verify contents rather than versions.</p> </blockquote> <p>Shannon and Steven mentioned this before but I think, it should be part of the accepted answer.</p> <hr> <h2>Update</h2> <p>The source listed for the below recommendation <a href="https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git">has been updated</a>. They are no longer recommending the <code>node_modules</code> folder be committed.</p> <blockquote> <p>Usually, no. Allow npm to resolve dependencies for your packages.</p> <p>For packages you deploy, such as websites and apps, you should use npm shrinkwrap to lock down your full dependency tree:</p> <p><a href="https://docs.npmjs.com/cli/shrinkwrap">https://docs.npmjs.com/cli/shrinkwrap</a></p> </blockquote> <hr> <h2>Original Post</h2> <p>For reference, npm FAQ answers your question clearly:</p> <blockquote> <p>Check node_modules into git for things you deploy, such as websites and apps. Do not check node_modules into git for libraries and modules intended to be reused. Use npm to manage dependencies in your dev environment, but not in your deployment scripts.</p> </blockquote> <p>and for some good rationale for this, read <a href="https://web.archive.org/web/20150116024411/http://www.futurealoof.com/posts/nodemodules-in-git.html">Mikeal Rogers' post on this</a>.</p> <hr> <p>Source: <a href="https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git">https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload