Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install not pulling in devDependencies

Tags:

node.js

npm

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?

like image 878
lostintranslation Avatar asked Jun 28 '13 21:06

lostintranslation


People also ask

Does npm install install devDependencies?

NPM installs devDependencies within the package. json file. The 'npm install' command should add all the dependencies and devDependencies automatically during installation. If you need to add specific devDependencies to your project, you can use this command- 'npm install --save-dev'.

How do I add packages to devDependencies?

To add dependencies and devDependencies to a package. json file from the command line, you can install them in the root directory of your package using the --save-prod flag for dependencies (the default behavior of npm install ) or the --save-dev flag for devDependencies.

Why is npm install not working on CMD?

The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.

Why is npm install failing?

code 1 error usually occurs when you run the npm install command. This cause of this error is that one of the dependencies you define in your package. json file fails to be installed properly on your computer. This means that npm fails to install the node-sass module that's added as a dependency to the n-app project.


1 Answers

Although not directly related to this question, it may be of interest to some to know that if environment variable NODE_ENV is set to production, npm will ignore devDependencies when executing npm install.

like image 191
Gudlaugur Egilsson Avatar answered Oct 21 '22 20:10

Gudlaugur Egilsson