npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

need to run `npm install` twice

What I Wanted to Do

Run npm install once per module and have things work.

What Happened Instead

Some times, I need to run npm install twice.

It would be good for npm to

  1. auto-warn when this becomes necessary and
  2. provide specific changes on how to solve the problem.

I believe, this is the same problem as this github issue, though it might be only one instance of the problem.

Reproduction Steps

Please see reproduction-steps - it includes a minimal problem reproduction with all associated information.



Platform Info

$ npm --versions
{ app2: '1.0.0',
  npm: '6.4.1',
  ares: '1.10.1-DEV',
  cldr: '31.0.1',
  http_parser: '2.7.0',
  icu: '59.1',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.8.1',
  openssl: '1.0.2l',
  tz: '2017b',
  unicode: '9.0',
  uv: '1.15.0',
  v8: '6.1.534.42',
  zlib: '1.2.11' }

$  node -p process.platform

When installing this twice, then removing node_modules & package-lock.json, then installing once again, it’s fixed already. So, my theory is that npm takes a different install path when things aren’t in the cache, and I’m not sure if that’s true for just Git deps, or registry deps too.

Yep, running with --prefer-online seems to have the same behaviour – interesting.

Edit: Now I can’t reproduce it at all anymore…