npm / registry-issue-archive

An archive of the old npm registry issue tracker
https://npm.community
249 stars 47 forks source link

Missing package versions depending on accept header #247

Closed ganemone closed 6 years ago

ganemone commented 6 years ago

Seeing an odd issue where the latest version of a published package is failing to install. I have tracked it down to some odd behavior with the registry and the accept header.

The npm info command shows the latest version (0.2.1)

$ npm info fusion-plugin-styletron-react versions

[ '0.1.0',
  '0.1.1',
  '0.1.2',
  '0.1.3',
  '0.1.4',
  '0.1.8',
  '0.1.9',
  '0.2.0',
  '0.2.1' ]

Verbose logged npm install shows a failed install due to an ETARGET error.

$ npm install fusion-plugin-styletron-react@0.2.1 --verbose          
npm info it worked if it ends with ok
npm verb cli [ '/Users/ganemone/.nvm/versions/node/v8.9.1/bin/node',
npm verb cli   '/Users/ganemone/.nvm/versions/node/v8.9.1/bin/npm',
npm verb cli   'install',
npm verb cli   'fusion-plugin-styletron-react@0.2.1',
npm verb cli   '--verbose' ]
npm info using npm@5.5.1
npm info using node@v8.9.1
npm verb npm-session a6754ba465ae5169
npm http fetch GET 200 https://registry.npmjs.org/fusion-plugin-styletron-react 11ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/fusion-plugin-styletron-react 80ms (from cache)
npm verb type version
npm verb stack fusion-plugin-styletron-react: No matching version found for fusion-plugin-styletron-react@0.2.1
npm verb stack     at pickManifest (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/pacote/node_modules/npm-pick-manifest/index.js:61:11)
npm verb stack     at fetchPackument.then.packument (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/manifest.js:51:18)
npm verb stack From previous event:
npm verb stack     at fetchPackument.then.packument (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/manifest.js:50:58)
npm verb stack     at runCallback (timers.js:789:20)
npm verb stack     at tryOnImmediate (timers.js:751:5)
npm verb stack     at processImmediate [as _immediateCallback] (timers.js:722:5)
npm verb stack From previous event:
npm verb stack     at getManifest (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/manifest.js:37:52)
npm verb stack     at manifest (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/manifest.js:24:10)
npm verb stack     at Object.manifest (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/pacote/lib/fetchers/registry/index.js:12:12)
npm verb stack     at Object.Fetcher#manifest [as manifest] (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/pacote/node_modules/protoduck/node_modules/genfun/lib/genfun.js:15:38)
npm verb stack     at manifest (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/pacote/lib/fetch.js:16:18)
npm verb stack     at pinflight (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/pacote/manifest.js:24:12)
npm verb stack     at /Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/promise-inflight/inflight.js:29:24
npm verb stack From previous event:
npm verb stack     at _inflight (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/promise-inflight/inflight.js:28:25)
npm verb stack     at /Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/promise-inflight/inflight.js:22:14
npm verb stack     at runCallback (timers.js:789:20)
npm verb stack     at tryOnImmediate (timers.js:751:5)
npm verb stack     at processImmediate [as _immediateCallback] (timers.js:722:5)
npm verb stack From previous event:
npm verb stack     at inflight (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/promise-inflight/inflight.js:14:40)
npm verb stack     at Object.manifest (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/pacote/manifest.js:22:10)
npm verb stack     at fetchPackageMetadata (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/lib/fetch-package-metadata.js:58:10)
npm verb stack     at limited (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/call-limit/call-limit.js:29:10)
npm verb stack     at /Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/lib/install/deps.js:229:14
npm verb stack     at /Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:35
npm verb stack     at Array.forEach (<anonymous>)
npm verb stack     at /Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:11
npm verb stack     at Array.forEach (<anonymous>)
npm verb stack     at asyncMap (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/slide/lib/async-map.js:51:8)
npm verb stack     at exports.getAllMetadata (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/lib/install/deps.js:200:3)
npm verb stack     at Installer.loadArgMetadata (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/lib/install.js:325:3)
npm verb stack     at /Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/lib/install.js:656:16
npm verb stack     at BB.join.then (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/lib/install/read-shrinkwrap.js:41:16)
npm verb stack From previous event:
npm verb stack     at readShrinkwrap (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/lib/install/read-shrinkwrap.js:41:5)
npm verb stack     at /Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/lib/install.js:652:7
npm verb stack     at /Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/iferr/index.js:13:50
npm verb stack     at thenHandleErrors (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:235:5)
npm verb stack     at f (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/once/once.js:25:25)
npm verb stack     at handleComplete (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:22:28)
npm verb stack     at f (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/once/once.js:25:25)
npm verb stack     at asyncForEach (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:11:31)
npm verb stack     at thenProcessChildren (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:202:12)
npm verb stack     at f (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/once/once.js:25:25)
npm verb stack     at thenSortChildren (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:167:5)
npm verb stack     at asyncForEach (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:11:31)
npm verb stack     at thenLoadKids (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/read-package-tree/rpt.js:150:5)
npm verb stack     at /Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/readdir-scoped-modules/readdir.js:24:14
npm verb stack     at /Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/dezalgo/dezalgo.js:17:12
npm verb stack     at RawTask.call (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/dezalgo/node_modules/asap/asap.js:40:19)
npm verb stack     at flush (/Users/ganemone/.nvm/versions/node/v8.9.1/lib/node_modules/npm/node_modules/dezalgo/node_modules/asap/raw.js:50:29)
npm verb stack     at _combinedTickCallback (internal/process/next_tick.js:131:7)
npm verb stack     at process._tickCallback (internal/process/next_tick.js:180:9)
npm verb cwd /Users/ganemone/dev/test
npm verb Darwin 17.2.0
npm verb argv "/Users/ganemone/.nvm/versions/node/v8.9.1/bin/node" "/Users/ganemone/.nvm/versions/node/v8.9.1/bin/npm" "install" "fusion-plugin-styletron-react@0.2.1" "--verbose"
npm verb node v8.9.1
npm verb npm  v5.5.1
npm ERR! code ETARGET
npm ERR! notarget No matching version found for fusion-plugin-styletron-react@0.2.1
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm verb exit [ 1, true ]

If I curl the metadata endpoint directly, and include the accept header included by the npm and yarn clients, I don't see the 0.2.1 version.

$ curl -H 'Accept: application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*' https://registry.npmjs.com/fusion-plugin-styletron-react | jq '.versions | keys' 
[
  "0.1.0",
  "0.1.1",
  "0.1.2",
  "0.1.3",
  "0.1.4",
  "0.1.8",
  "0.1.9",
  "0.2.0"
]

If you remove the accept header, it returns the 0.2.1 version correctly.

$ curl https://registry.npmjs.com/fusion-plugin-styletron-react | jq '.versions | keys'
[
  "0.1.0",
  "0.1.1",
  "0.1.2",
  "0.1.3",
  "0.1.4",
  "0.1.8",
  "0.1.9",
  "0.2.0",
  "0.2.1"
]
soldair commented 6 years ago

hey @ganemone thanks for the report.

I forced a change to the document with npm star and the new version was replicated to the "corgi" document correctly.

we changed some backends today and i'll track down the root cause.

soldair commented 6 years ago

looks like this is fixed. thanks again for the report.