Check the NPM docs for install
With the --production
flag (or when the NODE_ENV environment variable is set to production), npm will not install modules listed in devDependencies."
The --only={prod[uction]|dev[elopment]}
argument will cause either only devDependencies or only non-devDependencies to be installed regardless of the NODE_ENV."
Have you tried
npm install --only=dev
If you are worried that your package.json might be incorrect, best thing to do is this. Create a new folder, and run:
npm init --yes
Then:
npm install --save-dev brunch@^2.0.4
npm install --save-dev cssnano-brunch@^1.1.5
npm install --save-dev javascript-brunch@^1.8.0
npm install --save-dev sass-brunch@^1.9.2
npm install --save-dev uglify-js-brunch@^1.7.8
npm install jquery@^2.1.4 --save
And you should be good to go! Otherwise, will keep posting other options.
Check your npm configuration:
npm config list
npm gets its config settings from the command line, environment variables, and npmrc files. So check environment variables, and the npmrc file.
Still failing?
Ok, create a new folder, ideally somewhere else on your filesystem. ie. not in same folder hierarchy. For instance, C:\myNewFolder - the closer to the base C: drive the better.
Then run:
npm init --yes
Now run:
npm install underscore --save
and finally:
npm install mocha --save-dev
Does everything work as expected?
What I am trying to do is understand whether your problem is global, or something local to the previous folder and dependencies.
devDependencies
are literally dependencies for the developers of the module. I bet most of usnpm install
a module to use it, rather than develop it. – Константин ВанdevDependencies
is needed only when you write the package (application). Using it does not require thedevDependencies
. So it is reasonable fordevDependencies
to require extra flags to be installed. Ifnpm install
installeddevDependencies
by default, the users would get redundant packages as well. – Константин Ванnpm i
in my folder it grabs pypackage.json
and installs both deps and devdeps. This is the way it's intended to work and it makes sense (e.g. when I donpm i
aftergit clone
I expect to have all I need, including e.g. webpack plugins). This question addresses a bug, when the actual behaviour is different from intended. pls, take a look at docs - docs.npmjs.com/cli/install . There's a flag to not install devdeps, but the default behavior is to install them, which makes perfect sense and is what everybody expects – Tristan Tzaranpm i
should bootstrap both, which is the intended, sane and documented behavior, so I honestly don't understand why you say that this issue should be a standard – Tristan Tzara