lostintranslation lostintranslation - 1 year ago 241
Node.js Question

npm install not pulling in devDependencies

I have npm v 1.2.32

When I run:
$npm install mongo-migrate

it does not install mongodb which is a devDependency.

What am I doing wrong?

Answer Source

When you install a package from the NPM repository, dev dependencies won't automatically be installed as well (because those dependencies shouldn't be necessary to get the main package working properly).

You need to explicitly instruct npm to install dev dependencies too:

npm install mongo-migrate --dev


The --dev command has been deprecated.

npm WARN install Usage of the --dev option is deprecated. Use --only=dev instead.

npm install mongo-migrate --only=dev
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download