Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trouble running setup script #712

Closed
claytron5000 opened this issue May 8, 2019 · 4 comments
Closed

Trouble running setup script #712

claytron5000 opened this issue May 8, 2019 · 4 comments

Comments

@claytron5000
Copy link

  • downshift version: 0.0.0-semantically-released
  • node version: v8.12.0
  • npm (or yarn) version: 6.4.1

Relevant code or config

What you did:
Ran npm setup
What happened:
Setup fails. I've seen the similar issue, but I'm using a proper node version, permissions are not sudo-ed.

Reproduction repository:
Here's the full log from running npm run setup

0 info it worked if it ends with ok
1 verbose cli [ '/Users/clayton/.nvm/versions/node/v8.12.0/bin/node',
1 verbose cli   '/Users/clayton/.nvm/versions/node/v8.12.0/bin/npm',
1 verbose cli   'run',
1 verbose cli   'setup' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'presetup', 'setup', 'postsetup' ]
5 info lifecycle [email protected]~presetup: [email protected]
6 info lifecycle [email protected]~setup: [email protected]
7 verbose lifecycle [email protected]~setup: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~setup: PATH: /Users/clayton/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/clayton/Projects/downshift/node_modules/.bin:/Users/clayton/.rvm/gems/ruby-2.1.1/bin:/Users/clayton/.rvm/gems/ruby-2.1.1@global/bin:/Users/clayton/.rvm/rubies/ruby-2.1.1/bin:/bin:/Users/clayton/.rvm/bin:/opt/local/bin:/opt/local/sbin:/Users/clayton/.nvm/versions/node/v8.12.0/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/Users/clayton/.pyenv/shims:/usr/local/opt/python/libexec/bin:/usr/local/sbin:/Users/clayton/bin:/usr/local/bin:/Users/clayton/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/opt/X11/bin:/Applications/Wireshark.app/Contents/MacOS:/Users/clayton/.composer/vendor/bin:/Users/clayton/go/bin/Users/clayton/.cargo/bin
9 verbose lifecycle [email protected]~setup: CWD: /Users/clayton/Projects/downshift
10 silly lifecycle [email protected]~setup: Args: [ '-c', 'npm install && npm run validate' ]
11 silly lifecycle [email protected]~setup: Returned: code: 1  signal: null
12 info lifecycle [email protected]~setup: Failed to exec setup script
13 verbose stack Error: [email protected] setup: `npm install && npm run validate`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/Users/clayton/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:301:16)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at EventEmitter.emit (events.js:214:7)
13 verbose stack     at ChildProcess.<anonymous> (/Users/clayton/.nvm/versions/node/v8.12.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:126:13)
13 verbose stack     at ChildProcess.emit (events.js:214:7)
13 verbose stack     at maybeClose (internal/child_process.js:915:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/clayton/Projects/downshift
16 verbose Darwin 18.5.0
17 verbose argv "/Users/clayton/.nvm/versions/node/v8.12.0/bin/node" "/Users/clayton/.nvm/versions/node/v8.12.0/bin/npm" "run" "setup"
18 verbose node v8.12.0
19 verbose npm  v6.4.1
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] setup: `npm install && npm run validate`
22 error Exit status 1
23 error Failed at the [email protected] setup script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Problem description:
I'm trying to setup the project to contribute back, unfortunately I can't get through this step. I
Suggested solution:
It looks like flow test coverage is incomplete. I'm not sure how to get more info that this:

┌─────────────────────┬────────────┬─────────┬───────┬─────────┬───────────┐
│ filename            │ annotation │ percent │ total │ covered │ uncovered │
│ test/basic.test.js  │       flow │    97 % │    89 │      87 │ 2         │
│ test/custom.test.js │       flow │    97 % │    79 │      77 │ 2         │
└─────────────────────┴────────────┴─────────┴───────┴─────────┴───────────┘
┌─────────────────────────┬─────────────────────────────────────────┐
│ included glob patterns: │ test/**/*.js                            │
│ excluded glob patterns: │ node_modules/**                         │
│              threshold: │ 90                                      │
│       concurrent files: │ 1                                       │
│           generated at: │ Wed May 08 2019 14:02:18 GMT-0400 (EDT) │
│           flow version: │ 0.89.0                                  │
│      flow check passed: │ no (4 errors)                           │
└─────────────────────────┴─────────────────────────────────────────┘
┌───────────┬─────────┬───────┬─────────┬───────────┐
│ project   │ percent │ total │ covered │ uncovered │
│ downshift │    97 % │   168 │     164 │         4 │
└───────────┴─────────┴───────┴─────────┴───────────┘
@claytron5000
Copy link
Author

One running npm run test:flow I got a little more information.

Cannot determine the type of props [1] because it contains a spread of inexact object type [2]. Being inexact, object
type [2] might be missing the types of some properties that are being copied. Perhaps you could make it exact?
(inexact-spread)

Appears four times. Full output to follow.

> flow

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ flow-typed/npm/downshift_v2.x.x.js.flow:180:40

Cannot determine the type of props [1] because it contains a spread of inexact object type [2]. Being inexact, object
type [2] might be missing the types of some properties that are being copied. Perhaps you could make it exact?
(inexact-spread)

     flow-typed/npm/downshift_v2.x.x.js.flow
     177│   declare export interface GetInputPropsOptions
     178│     extends React.HTMLProps<HTMLInputElement> {}
     179│
 [2] 180│   declare type GetItemPropsCallbacks = {
     181│     onMouseMove: (e: SyntheticEvent<Element>) => void;
     182│     onMouseDown: (e: SyntheticEvent<Element>) => void;
     183│   } & ({
     184│     onPress: (e: SyntheticEvent<Element>) => void;
     185│   } | {
     186│     onClick: (e: SyntheticEvent<Element>) => void;

     test/custom.test.js
 [1]  60│                   <CustomListItem
      61│                     key={index}
      62│                     {...getItemProps({
      63│                       item,
      64│                       index,
      65│                       isSelected: selectedItem === item,
      66│                     })}
      67│                   >
      68│                     {item}
      69│                   </CustomListItem>


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ flow-typed/npm/downshift_v2.x.x.js.flow:183:8

Cannot determine the type of props [1] because it contains a spread of inexact object type [2]. Being inexact, object
type [2] might be missing the types of some properties that are being copied. Perhaps you could make it exact?
(inexact-spread)

     flow-typed/npm/downshift_v2.x.x.js.flow
     180│   declare type GetItemPropsCallbacks = {
     181│     onMouseMove: (e: SyntheticEvent<Element>) => void;
     182│     onMouseDown: (e: SyntheticEvent<Element>) => void;
 [2] 183│   } & ({
     184│     onPress: (e: SyntheticEvent<Element>) => void;
     185│   } | {
     186│     onClick: (e: SyntheticEvent<Element>) => void;
     187│   })
     188│   declare export type GetItemPropsReturn = {

     test/custom.test.js
 [1]  60│                   <CustomListItem
      61│                     key={index}
      62│                     {...getItemProps({
      63│                       item,
      64│                       index,
      65│                       isSelected: selectedItem === item,
      66│                     })}
      67│                   >
      68│                     {item}
      69│                   </CustomListItem>


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ flow-typed/npm/downshift_v2.x.x.js.flow:185:7

Cannot determine the type of props [1] because it contains a spread of inexact object type [2]. Being inexact, object
type [2] might be missing the types of some properties that are being copied. Perhaps you could make it exact?
(inexact-spread)

     flow-typed/npm/downshift_v2.x.x.js.flow
     182│     onMouseDown: (e: SyntheticEvent<Element>) => void;
     183│   } & ({
     184│     onPress: (e: SyntheticEvent<Element>) => void;
 [2] 185│   } | {
     186│     onClick: (e: SyntheticEvent<Element>) => void;
     187│   })
     188│   declare export type GetItemPropsReturn = {
     189│     id: string;
     190│     role: 'option';

     test/custom.test.js
 [1]  60│                   <CustomListItem
      61│                     key={index}
      62│                     {...getItemProps({
      63│                       item,
      64│                       index,
      65│                       isSelected: selectedItem === item,
      66│                     })}
      67│                   >
      68│                     {item}
      69│                   </CustomListItem>


Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ flow-typed/npm/downshift_v2.x.x.js.flow:188:44

Cannot determine the type of props [1] because it contains a spread of inexact object type [2]. Being inexact, object
type [2] might be missing the types of some properties that are being copied. Perhaps you could make it exact?
(inexact-spread)

     flow-typed/npm/downshift_v2.x.x.js.flow
     185│   } | {
     186│     onClick: (e: SyntheticEvent<Element>) => void;
     187│   })
 [2] 188│   declare export type GetItemPropsReturn = {
     189│     id: string;
     190│     role: 'option';
     191│     'aria-selected': boolean;
     192│   } & GetItemPropsCallbacks
     193│   declare export type GetItemPropsOptions<Item> = {
     194│     index?: number,
     195│     item: Item,

     test/custom.test.js
 [1]  60│                   <CustomListItem
      61│                     key={index}
      62│                     {...getItemProps({
      63│                       item,
      64│                       index,
      65│                       isSelected: selectedItem === item,
      66│                     })}
      67│                   >
      68│                     {item}
      69│                   </CustomListItem>

@silviuaavram
Copy link
Collaborator

interesting, I have no idea of how those flow types work. I will try an npm setup myself later today and see if I reproduce it.

@claytron5000
Copy link
Author

It looks like the flow document is automatically generated. http://github.com/joarwilk/flowgen. It also looks like the ...getItemProps is the offending spread. There's an issue around spread in the flow repo: facebook/flow#2405.

I'm really not sure if this will require a work-around, or if there's a way I can bypass this step and still contribute. Remember, the goal for me here is contribute back to the project, so whatever aids with that in mind.

@silviuaavram
Copy link
Collaborator

I updated our dependencies recently and running setup should work fine. Maybe do npm reinstall, cache clean, remove package lock if you have any, figure out what the flow errors mean. I personally don't have any knowledge of flow, so cannot assist you there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants