This testcase replicates an error of:
npm ERR! missing: [email protected], required by [email protected]
That happens with node v6.10.3 and npm v3.10.10 when npm ls
is run after install of the module. What appears to be happening is that:
- The module depends on
minimist@~1.2.0
- The module depends on
node-pre-gyp
which depends onmkdirp@^0.5.1
[email protected]
is pinned exactly to[email protected]
: https://github.com/substack/node-mkdirp/blob/f2003bbcffa80f8c9744579fabab1212fc84545a/package.json#L19- During npm install the
mkdirp
is installed in the node-pre-gyp modules folder - With node v0.10, v4, and v7 the
[email protected]
is installed at the top level and[email protected]
is installed within themkdirp
dependended upon mynode-pre-gyp
. - With node v6 the
[email protected]
is installed at the top level and[email protected]
is NOT installed within themkdirp
dependended upon mynode-pre-gyp
. - During npm install
node-pre-gyp
is run and themkdirp
appears to work at runtime with all versions of node despite the deduping problem with node v6 - Npm runs
prepublish
during install - context at https://github.com/npm/npm/blob/latest/CHANGELOG.md#new-prepare-script-prepublish-deprecated-breaking - With node v6 the
npm ls
that is run duringprepublish
(which is automatically run by npm at the end of the install) errors since the pinnned[email protected]
is missing.
The tree that npm ls
is outputs (when it returns an error with node v6) is:
└─┬ [email protected]
├���┬ [email protected]
│ └── UNMET DEPENDENCY [email protected]
This does not happen with node v7 and npm v4.2.0