isaacs/npm — Issue #1983: bundleDependencies not bundling dependencies of bundled packages
Author: rmyates
Created: 2012-01-04 09:54:02+00:00
State: open

I'm not sure if this is intended behaviour but I'm having an issue when using bundleDependencies.

The scenario is I have a package with my companies code in it which will be deployed therefore I wanted to bundle all the dependencies into a single package to have a consistent deployment across multiple hosts. However it would appear that the bundled dependencies of my package doesn't include their dependencies.

For example, package A has a bundled dependency on package B which in turn includes package C. If I npm install package B into A's folder it pulls in C successfully. However if I then npm pack package A and install it somewhere temporary I get an unmet dependency C.

Of course if I don't bundle B into package A then install it somewhere it pulls in C correctly. But from a deployment point of view I don't want to do that as the dependency C could change at any time and break the deployment and/or give an inconsistent deploy which obviously I want to avoid. I notice the edit here (https://github.com/isaacs/npm/issues/1886#issuecomment-3157706) which refers to .gitignore and .npmignore which makes sense, but if any of the packages I'm depending on have a .gitignore and/or npmignore file which takes out node_modules I assume npm pack then skips it which possibly is what's causing the unmet dependency issue I'm seeing. Practical example is the cli-color package.