How to deploy host application dependencies? How can I ensure that certain versions of a package are installed with npm?

What is the best way to deploy dependencies for an application host. How can I ensure the installation of certain versions of the package with npm. Are there any recipe files like require.txt with Python pip?

+3
source share
1 answer

A package.jsondefines the module dependencies.

https://docs.npmjs.com/files/package.json#dependencies

{ "dependencies" :
  { "foo" : "1.0.0 - 2.9999.9999"
  , "bar" : ">=1.0.2 <2.1.2"
  , "baz" : ">1.0.2 <=2.3.4"
  , "boo" : "2.0.1"
  , "qux" : "<1.0.0 || >=2.3.1 <2.4.5 || >=2.5.2 <3.0.0"
  , "asd" : "http://asdf.com/asdf.tar.gz"
  , "til" : "~1.2"
  , "elf" : "~1.2.3"
  , "two" : "2.x"
  , "thr" : "3.3.x"
  , "lat" : "latest"
  , "dyl" : "file:../dyl"
  }
}
+6
source

All Articles