-
Notifications
You must be signed in to change notification settings - Fork 3k
npm install --dev is installing devDependencies recursively #5554
Comments
I have encountered the same issue, first of all The easiest way to overcome this was to join the My guess is that a better solution should exist. |
While |
+1 yeah, I experience the same problem. |
|
We're going to solve this problem by removing |
@othiym23 You guys should really remove it, because it's very confusing. I mean, you'd expect |
I'm facing the same problem on using |
@huei90 That's why it's going away :) |
Ok @kenany I saw that. Thanks! |
…s and merged with regular deps (due to recursive dl, see: npm/npm#5554). Built gulpfile that can run multiplatform and can build asar files. Needs final packaging.
…s and merged with regular deps (due to recursive dl, see: npm/npm#5554). Built gulpfile that can run multiplatform and can build asar files. Needs final packaging.
this has changed now...please use |
this has changed now...please use
npm install --only=dev
What does that?
|
The |
npm install --only=dev, |
I have seen some extrange behaviours of the
--dev
flag when trying to install a package that could not be able to seen explained anywhere, and in fact only was able to find contradictory info:npm install
on a package directory install onnode_modules
both itsdependencies
anddevDependencies
, but only the ones defined onpackage.json
file (just one level, not recursive). This package would be usually fetch from a git repository, since if done correctly, the package hosted on the NPM registry should contains the production-only files, since development files like Gruntfile.js or tests are mostly of interest only for developers of the package, and this ones will fetch it from a source code repository where to push changes later.npm install <package>
install that package insidenode_modules
with itsdependencies
, but not itsdevDependencies
.This ones work as expected. Now, the problematic ones:
npm install --dev
on a package directory install onnode_modules
both itsdependencies
anddevDependencies
, but it also installs recursivelly all thedevDependencies
of the packages defined ondependencies
anddevDependencies
.npm install <package> --dev
install that package insidenode_modules
with itsdependencies
, and also installs recursivelly all thedevDependencies
of itself and its dependencies.Is this on purpose, or is a bug? Didn't find any info regarding this, but seems in fact it's not a desirable behaviour and was commented to document it explicitly, but acording to NPM config documentation, production flag is disabled by default installing both
dependencies
anddevDependencies
, and when enabled, it only installsdependencies
. On the other hand, dev flag is also disabled by default, and when enabled, it installdevDependencies
, what I find conflicts with production flag (if they are installed by default, why to have a flag to install them? More than this, why instead it install ALL of them recursively? I find this behaviour really error prone, and it's use a waste of space and band-width and can't think of any real use case), so this lead me to think...The text was updated successfully, but these errors were encountered: