Using npm to install or update required packages just like bundler for rubygems

后端 未结 6 919
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-30 03:57

I love Bundler, it\'s great at dependency management. I love npm, installing node packages is easy! I have a nodejs app and would love to be able to specify my apps de

6条回答
  •  情歌与酒
    2021-01-30 04:24

    As of Npm version 1.1.2 , there's a new command npm shrinkwrap which creates an npm-shrinkwrapped.json file, analogous to Gemfile.lock. It's important to make one, to prevent software rot (see Bundler's rationale). Particularly as Nodejs has such a fast moving community.

    While bundle install creates a Gemfile.lock automatically, npm install won't create npm-shrinkwrapped.json (but will use it when it exists). Hence you need to remember to use npm shrinkwrap.

    Read a full guide at http://blog.nodejs.org/2012/02/27/managing-node-js-dependencies-with-shrinkwrap/

提交回复
热议问题