This repository has been archived by the owner. It is now read-only.

patr dependency fails on 3.6.0 #11398

Closed
logarytm opened this Issue Feb 3, 2016 · 7 comments

Comments

Projects
None yet
5 participants
@logarytm

logarytm commented Feb 3, 2016

{ 'diagoa-core': '0.0.0',
  npm: '3.6.0',
  ares: '1.10.1-DEV',
  http_parser: '2.6.0',
  icu: '56.1',
  modules: '47',
  node: '5.5.0',
  openssl: '1.0.2e',
  uv: '1.8.0',
  v8: '4.6.85.31',
  zlib: '1.2.8' }

npm install compose fails on patr dependency:

image

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'install', '--save', 'compose' ]
2 info using npm@3.6.0
3 info using node@v5.5.0
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData compose
8 silly fetchNamedPackageData compose
9 silly mapToRegistry name compose
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry https://registry.npmjs.org/
12 silly mapToRegistry uri https://registry.npmjs.org/compose
13 verbose request uri https://registry.npmjs.org/compose
14 verbose request no auth needed
15 info attempt registry request try #1 at 14:00:05
16 verbose request id db394a2c7acc890f
17 verbose etag "8FO5F8FYAPVQ3ONV2LO5EASCI"
18 http request GET https://registry.npmjs.org/compose
19 http 304 https://registry.npmjs.org/compose
20 verbose headers { date: 'Wed, 03 Feb 2016 13:00:05 GMT',
20 verbose headers   via: '1.1 varnish',
20 verbose headers   'cache-control': 'max-age=300',
20 verbose headers   etag: '"8FO5F8FYAPVQ3ONV2LO5EASCI"',
20 verbose headers   age: '0',
20 verbose headers   connection: 'keep-alive',
20 verbose headers   'x-served-by': 'cache-ams4142-AMS',
20 verbose headers   'x-cache': 'MISS',
20 verbose headers   'x-cache-hits': '0',
20 verbose headers   'x-timer': 'S1454504405.745262,VS0,VE336',
20 verbose headers   vary: 'Accept' }
21 silly get cb [ 304,
21 silly get   { date: 'Wed, 03 Feb 2016 13:00:05 GMT',
21 silly get     via: '1.1 varnish',
21 silly get     'cache-control': 'max-age=300',
21 silly get     etag: '"8FO5F8FYAPVQ3ONV2LO5EASCI"',
21 silly get     age: '0',
21 silly get     connection: 'keep-alive',
21 silly get     'x-served-by': 'cache-ams4142-AMS',
21 silly get     'x-cache': 'MISS',
21 silly get     'x-cache-hits': '0',
21 silly get     'x-timer': 'S1454504405.745262,VS0,VE336',
21 silly get     vary: 'Accept' } ]
22 verbose etag https://registry.npmjs.org/compose from cache
23 verbose get saving compose to /home/olgierd/.npm/registry.npmjs.org/compose/.cache.json
24 verbose correctMkdir /home/olgierd/.npm correctMkdir not in flight; initializing
25 silly install normalizeTree
26 silly loadCurrentTree Finishing
27 silly loadIdealTree Starting
28 silly install loadIdealTree
29 silly cloneCurrentTree Starting
30 silly install cloneCurrentTreeToIdealTree
31 silly cloneCurrentTree Finishing
32 silly loadShrinkwrap Starting
33 silly install loadShrinkwrap
34 silly loadShrinkwrap Finishing
35 silly loadAllDepsIntoIdealTree Starting
36 silly install loadAllDepsIntoIdealTree
37 silly resolveWithNewModule compose@0.1.2 checking installable status
38 silly cache add args [ 'compose', null ]
39 verbose cache add spec compose
40 silly cache add parsed spec Result {
40 silly cache add   raw: 'compose',
40 silly cache add   scope: null,
40 silly cache add   name: 'compose',
40 silly cache add   rawSpec: '',
40 silly cache add   spec: 'latest',
40 silly cache add   type: 'tag' }
41 silly addNamed compose@latest
42 verbose addNamed "latest" is being treated as a dist-tag for compose
43 info addNameTag [ 'compose', 'latest' ]
44 silly mapToRegistry name compose
45 silly mapToRegistry using default registry
46 silly mapToRegistry registry https://registry.npmjs.org/
47 silly mapToRegistry uri https://registry.npmjs.org/compose
48 verbose addNameTag registry:https://registry.npmjs.org/compose not in flight; fetching
49 verbose get https://registry.npmjs.org/compose not expired, no request
50 silly addNameTag next cb for compose with tag latest
51 silly addNamed compose@0.1.2
52 verbose addNamed "0.1.2" is a plain semver version for compose
53 silly cache afterAdd compose@0.1.2
54 verbose afterAdd /home/olgierd/.npm/compose/0.1.2/package/package.json not in flight; writing
55 verbose correctMkdir /home/olgierd/.npm correctMkdir not in flight; initializing
56 verbose afterAdd /home/olgierd/.npm/compose/0.1.2/package/package.json written
57 silly fetchNamedPackageData patr
58 silly mapToRegistry name patr
59 silly mapToRegistry using default registry
60 silly mapToRegistry registry https://registry.npmjs.org/
61 silly mapToRegistry uri https://registry.npmjs.org/patr
62 verbose request uri https://registry.npmjs.org/patr
63 verbose request no auth needed
64 info attempt registry request try #1 at 14:00:06
65 verbose etag "E57RXCEMR2AZE6R5QCHMU8AFW"
766 http request GET https://registry.npmjs.org/patr
67 http 304 https://registry.npmjs.org/patr
68 verbose headers { date: 'Wed, 03 Feb 2016 13:00:06 GMT',
68 verbose headers   via: '1.1 varnish',
68 verbose headers   'cache-control': 'max-age=300',
68 verbose headers   etag: '"E57RXCEMR2AZE6R5QCHMU8AFW"',
68 verbose headers   age: '176',
68 verbose headers   connection: 'keep-alive',
68 verbose headers   'x-served-by': 'cache-ams4139-AMS',
68 verbose headers   'x-cache': 'HIT',
68 verbose headers   'x-cache-hits': '1',
68 verbose headers   'x-timer': 'S1454504406.423995,VS0,VE0',
68 verbose headers   vary: 'Accept' }
69 silly get cb [ 304,
69 silly get   { date: 'Wed, 03 Feb 2016 13:00:06 GMT',
69 silly get     via: '1.1 varnish',
69 silly get     'cache-control': 'max-age=300',
69 silly get     etag: '"E57RXCEMR2AZE6R5QCHMU8AFW"',
69 silly get     age: '176',
69 silly get     connection: 'keep-alive',
69 silly get     'x-served-by': 'cache-ams4139-AMS',
69 silly get     'x-cache': 'HIT',
69 silly get     'x-cache-hits': '1',
69 silly get     'x-timer': 'S1454504406.423995,VS0,VE0',
69 silly get     vary: 'Accept' } ]
70 verbose etag https://registry.npmjs.org/patr from cache
71 verbose get saving patr to /home/olgierd/.npm/registry.npmjs.org/patr/.cache.json
72 verbose correctMkdir /home/olgierd/.npm correctMkdir not in flight; initializing
73 verbose stack Error: Missing required argument #1
73 verbose stack     at andLogAndFinish (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:31:3)
73 verbose stack     at fetchPackageMetadata (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:51:22)
73 verbose stack     at resolveWithNewModule (/usr/lib/node_modules/npm/lib/install/deps.js:456:12)
73 verbose stack     at /usr/lib/node_modules/npm/lib/install/deps.js:457:7
73 verbose stack     at /usr/lib/node_modules/npm/node_modules/iferr/index.js:13:50
73 verbose stack     at /usr/lib/node_modules/npm/lib/fetch-package-metadata.js:37:12
73 verbose stack     at addRequestedAndFinish (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:82:5)
73 verbose stack     at returnAndAddMetadata (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:117:7)
73 verbose stack     at pickVersionFromRegistryDocument (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:134:20)
73 verbose stack     at /usr/lib/node_modules/npm/node_modules/iferr/index.js:13:50
74 verbose cwd /home/olgierd/Code/diagoa/packages/diagoa-core
75 error Linux 3.14.51-1-lts-ck
76 error argv "/usr/bin/node" "/usr/bin/npm" "install" "--save" "compose"
77 error node v5.5.0
78 error npm  v3.6.0
79 error code EMISSINGARG
80 error typeerror Error: Missing required argument #1
80 error typeerror     at andLogAndFinish (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:31:3)
80 error typeerror     at fetchPackageMetadata (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:51:22)
80 error typeerror     at resolveWithNewModule (/usr/lib/node_modules/npm/lib/install/deps.js:456:12)
80 error typeerror     at /usr/lib/node_modules/npm/lib/install/deps.js:457:7
80 error typeerror     at /usr/lib/node_modules/npm/node_modules/iferr/index.js:13:50
80 error typeerror     at /usr/lib/node_modules/npm/lib/fetch-package-metadata.js:37:12
80 error typeerror     at addRequestedAndFinish (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:82:5)
80 error typeerror     at returnAndAddMetadata (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:117:7)
80 error typeerror     at pickVersionFromRegistryDocument (/usr/lib/node_modules/npm/lib/fetch-package-metadata.js:134:20)
80 error typeerror     at /usr/lib/node_modules/npm/node_modules/iferr/index.js:13:50
81 error typeerror This is an error with npm itself. Please report this error at:
81 error typeerror     <http://github.com/npm/npm/issues>
82 verbose exit [ 1, true ]

@zkat

This comment has been minimized.

Member

zkat commented May 2, 2016

confirmed that I can repro this with a simple npm i -S compose on npm@3.8.9

@theofidry

This comment has been minimized.

theofidry commented May 9, 2016

Hello,

I have the same issue both locally (OSX 10.9) and on Travis (cf. build).

  • node: 4.2.6
  • npm: 3.9.0

Short message:

screen shot 2016-05-09 at 18 23 09

Full npm-debug.log content here.

@theofidry

This comment has been minimized.

theofidry commented May 9, 2016

Btw there's duplicates: #9659 & #12134

@iarna

This comment has been minimized.

Member

iarna commented Jun 21, 2016

@theofidry Your issues are unrelated. The error message is an argument validation error, but your error is in an entirely different part of the code.

@zkat

This comment has been minimized.

Member

zkat commented Aug 9, 2016

(Can confirm this is still happening -- gonna look into it)

@zkat zkat self-assigned this Aug 9, 2016

@zkat

This comment has been minimized.

Member

zkat commented Aug 10, 2016

Ah. The culprit is right here: https://github.com/kriszyp/patr/blob/master/package.json#L29

If you take a look at install/deps.js#517, we kinda uhh... expect people to not use the type field in package.json at all, even though this is kinda just internal npm plumbing stuff.

I know @iarna and @othiym23 have talked about how to separate out these different files, or at least find other ways to prevent conflicts like these, so I'll talk to them about that (and, obviously, pull them into this issue ;p)

If you want it to Work For Now, you can just get the patr folks to drop the type field or maybe call it something else (not _type, please 😁 ). We'll talk about a better general fix for this.

zkat added a commit that referenced this issue Aug 11, 2016

zkat added a commit that referenced this issue Aug 11, 2016

install: fix hiccup that caused a conflict
Basically, there was some duck typing in `resolveWithNewModule`
in situations where the function got a `package.json` from `npa`,
rather than the internal request object.

The issue reared its head because of a package that had `type`
in its `package.json`, which confused the duck typing.

Instead, the special case was inlined into (afaict) the only
place where it was actually triggered from.

Fixes: #11398
Credit: @zkat

@iarna iarna closed this in 8f8d1b3 Aug 12, 2016

@theofidry

This comment has been minimized.

theofidry commented Aug 12, 2016

Thanks for the fix @zkat and @iarna, much appreciated

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.