sometimes install incorrectly skips "optional dependency" that isn't optional

cli
triaged
priority:medium

(Dominic Tarr) #1

What I Wanted to Do

Install a newer version of an already installed dependency.

What Happened Instead

it looked like it was installing, but then it says “skipping optional dependency {module_i_am_trying_to_install}”

Reproduction Steps

I’m not sure how to reproduce this, but I do get this fairly often. (more as it develops)

Details

these commands where all made in this sequence.
npm ls said there was a previous version,
npm install says it’s decided to skip it, but also that it’s successfully installed it.
npm ls says it’s needed, but not installed (guessing this means it updated the package.json but not node_modules)
npm install again, this time it looks right.
npm ls is happy.

$ npm ls ssb-ooo
ssb-server@14.0.4 /home/dominic/c/scuttlebot
`-- ssb-ooo@1.1.0 

[dominic@archlinux scuttlebot]$ npm install ssb-ooo@latest -S
npm http fetch GET 200 https://registry.npmjs.org/ssb-ooo 1173ms
npm http fetch GET 200 https://registry.npmjs.org/gossip-query 33ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/flumecodec 36ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/level-codec 140ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/fsevents 106ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/ssb-ooo/-/ssb-ooo-1.1.1.tgz 836ms
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: ssb-ooo@1.1.0 (node_modules/ssb-ooo):
npm WARN enoent SKIPPING OPTIONAL DEPENDENCY: ENOENT: no such file or directory, rename '/home/dominic/c/scuttlebot/node_modules/.staging/ssb-ooo-90239d4a' -> '/home/dominic/c/scuttlebot/node_modules/ssb-ooo'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ ssb-ooo@1.1.1
added 1 package from 1 contributor and updated 1 package in 8.913s
[dominic@archlinux scuttlebot]$ npm ls ssb-ooo
ssb-server@14.0.4 /home/dominic/c/scuttlebot
`-- UNMET DEPENDENCY ssb-ooo@^1.1.1

npm ERR! missing: ssb-ooo@^1.1.1, required by ssb-server@14.0.4
[dominic@archlinux scuttlebot]$ npm install ssb-ooo@latest -S
npm http fetch GET 200 https://registry.npmjs.org/ssb-ooo 67ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/flumecodec 24ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/level-codec 21ms (from cache)
npm http fetch GET 200 https://registry.npmjs.org/fsevents 34ms (from cache)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ ssb-ooo@1.1.1
added 3 packages from 1 contributor in 6.845s
[dominic@archlinux scuttlebot]$ npm ls ssb-ooo
ssb-server@14.0.4 /home/dominic/c/scuttlebot
`-- ssb-ooo@1.1.1 


Platform Info

$ npm --versions
 npm --versions
{ 'ssb-server': '14.0.4',
  npm: '6.4.1',
  ares: '1.10.1-DEV',
  cldr: '32.0',
  http_parser: '2.8.0',
  icu: '60.1',
  modules: '57',
  napi: '3',
  nghttp2: '1.33.0',
  node: '8.15.0',
  openssl: '1.0.2q',
  tz: '2017c',
  unicode: '10.0',
  uv: '1.23.2',
  v8: '6.2.414.75',
  zlib: '1.2.11' }

<!-- paste output here -->
$ node -p process.platform
linux
<!-- paste output here -->