
Npm install readable-stream -save -save-exact Npm install dtrace-provider -save-optional -save-exact: Saved dependencies will be configured with an exact version rather than using npm's default semver range operator.When using any of the above options to save dependencies to your package.json, there is an additional, optional flag: -save-optional: Package will appear in your optionalDependencies.
-save-dev: Package will appear in your devDependencies. -save: Package will appear in your dependencies. Npm install takes 3 exclusive, optional flags which save or update the package version in your main package.json: In most cases, this will install the latest version of the module published on npm. npm install :ĭo a install, where is the "tag" config. In order to distinguish between this and other options, the argument must start with " or " Example: Note: if you just want to link a dev directory into your npm root, you can do this more easily by using npm link.įetch the tarball url, and then install it. Install a package that is sitting on the filesystem. Install a package that is sitting in a folder on the filesystem. With the -production flag, npm will not install modules listed in devDependencies. In global mode (ie, with -g or -global appended to the command), it installs the current package context (ie, the current working directory) as a global package.īy default, npm install will install all modules listed as dependencies. Install the dependencies in the local node_modules folder. npm install (in package directory, no arguments):. See npm-shrinkwrap.Ī) a folder containing a program described by a package.json fileĭ) a that is published on the registry (npm help see npm-registry) with (c)į) a that has a "latest" tag satisfying (e)Įven if you never publish your package, you can still get a lot of benefits of using npm if you just want to write a node program (a), and perhaps if you also want to be able to easily install it elsewhere after packing it up into a tarball (b).
If the package has a shrinkwrap file, the installation of dependencies will be driven by that.
Npm help This command installs a package, and any packages that it depends on.