Skip to content

Receiving some errors on Windows. #48

Closed

Description

@jseminck

Hey all,

Today I added myself as a contributor to one OSS repo through the all-contributors CLI. I ended up receiving some errors, even though it looked like the contributors file was updated and a commit was made.

Here is the full log:

joachim@DESKTOP-O4ENA28 E:\projects\codesandbox-client
> npm run add

> react-sandbox@0.1.0 add E:\projects\codesandbox-client
> all-contributors add

? What is the contributor's GitHub username? jseminck
? What are the contribution types? 💻  Code
undefined
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-sandbox@0.1.0 add: `all-contributors add`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-sandbox@0.1.0 add script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\joachim\AppData\Roaming\npm-cache\_logs\2017-08-18T15_35_23_293Z-debug.log

joachim@DESKTOP-O4ENA28 E:\projects\codesandbox-client
> cat C:\Users\joachim\AppData\Roaming\npm-cache\_logs\2017-08-18T15_35_23_293Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'add' ]
2 info using npm@5.3.0
3 info using node@v8.4.0
4 verbose run-script [ 'preadd', 'add', 'postadd' ]
5 info lifecycle react-sandbox@0.1.0~preadd: react-sandbox@0.1.0
6 info lifecycle react-sandbox@0.1.0~add: react-sandbox@0.1.0
7 verbose lifecycle react-sandbox@0.1.0~add: unsafe-perm in lifecycle true
8 verbose lifecycle react-sandbox@0.1.0~add: PATH: C:\Users\joachim\AppData\Roaming\nvm\v8.4.0\node_modules\npm\bin\node-gyp-bin;E:\projects\codesandbox-client\node_modules\.bin;E:\projects\apps\conemu\ConEmu\Scripts;E:\projects\apps\conemu;E:\projects\apps\conemu\ConEmu;C:\Program Files\Docker\Docker\Resources\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Mercurial\;E:\projects\apps\apache-maven-3.3.9\bin;C:\Program Files\OpenVPN\bin;C:\Users\joachim\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Users\joachim\AppData\Local\Microsoft\WindowsApps;C:\Users\joachim\AppData\Roaming\npm;C:\Users\joachim\AppData\Local\atom\bin;C:\Users\joachim\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Users\joachim\AppData\Local\Microsoft\WindowsApps;;C:\Program Files (x86)\Microsoft VS Code\bin
9 verbose lifecycle react-sandbox@0.1.0~add: CWD: E:\projects\codesandbox-client
10 silly lifecycle react-sandbox@0.1.0~add: Args: [ '/d /s /c', 'all-contributors add' ]
11 silly lifecycle react-sandbox@0.1.0~add: Returned: code: 1  signal: null
12 info lifecycle react-sandbox@0.1.0~add: Failed to exec add script
13 verbose stack Error: react-sandbox@0.1.0 add: `all-contributors add`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\joachim\AppData\Roaming\nvm\v8.4.0\node_modules\npm\lib\utils\lifecycle.js:289:16)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at EventEmitter.emit (events.js:213:7)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\joachim\AppData\Roaming\nvm\v8.4.0\node_modules\npm\lib\utils\spawn.js:40:14)
13 verbose stack     at emitTwo (events.js:125:13)
13 verbose stack     at ChildProcess.emit (events.js:213:7)
13 verbose stack     at maybeClose (internal/child_process.js:927:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
14 verbose pkgid react-sandbox@0.1.0
15 verbose cwd E:\projects\codesandbox-client
16 verbose Windows_NT 10.0.15063
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "add"
18 verbose node v8.4.0
19 verbose npm  v5.3.0
20 error code ELIFECYCLE
21 error errno 1
22 error react-sandbox@0.1.0 add: `all-contributors add`
22 error Exit status 1
23 error Failed at the react-sandbox@0.1.0 add script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

If I installed the CLI manually, then I did not get any errors, just an undefined message:

joachim@DESKTOP-O4ENA28 E:\projects\codesandbox-client
> npm install all-contributors-cli -g
C:\Program Files\nodejs\all-contributors -> C:\Program Files\nodejs\node_modules\all-contributors-cli\cli.js
+ all-contributors-cli@4.4.0
added 144 packages in 21.045s

joachim@DESKTOP-O4ENA28 E:\projects\codesandbox-client
> all-contributors add
? What is the contributor's GitHub username? jseminck
? What are the contribution types? 💻  Code
undefined

Not sure, if it is related to me being on Windows... anyway, thought I'd report it in case anyone has had similar issues.

Activity

  1. kentcdodds commented on Aug 18, 2017

    @kentcdodds
    Member

    Thank you so much for reporting this! We definitely want this to work well for everyone regardless of the platform. Would you mind digging a little further to see what the problem is and suggest a solution?

    Also, thanks for contributing to codesandbox! I love that app!

  2. added
    type: bug
    help wanted
    on Aug 18, 2017
  3. jseminck commented on Aug 19, 2017

    @jseminck
    Author

    I just ran the same command on the downshift project, and it did not give me any errors nor the undefined message that I got when I installed the CLI globally. Maybe in codesandbox it still had an older/different version?

  4. cg-cnu commented on Aug 29, 2017

    @cg-cnu

    @kentcdodds Thanks for the awesome all-contributors 😄 I am also trying to add all-contributors-cli to bundlesize and faced the same issue on windows. siddharthkp/bundlesize#108 I will try and see if I can figure out the issue. Will report back 🙂

  5. donysukardi commented on Nov 2, 2017

    @donysukardi

    The error is not Windows specific. I traced back the error to line https://github.com/jfmengels/all-contributors-cli/blob/master/cli.js#L65, where auto git commit is supposed to happen.

    Apparently the error appears on repository that uses husky and lint-staged. I attached the remote debugging against the package installed by codesandbox-client and got the following error messages,

    (node:27123) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): husky > npm run -s precommit (node v8.4.0)
    
    [21:28:16] Running tasks for *.js [started]
    [21:28:16] Running tasks for *.css [started]
    [21:28:16] Running tasks for *.json [started]
    [21:28:16] Running tasks for *.js [skipped]
    [21:28:16] → No staged files match *.js
    [21:28:16] Running tasks for *.css [skipped]
    [21:28:16] → No staged files match *.css
    [21:28:16] Running tasks for *.json [skipped]
    [21:28:16] → No staged files match *.json 
    
  6. kentcdodds commented on Nov 2, 2017

    @kentcdodds
    Member

    Thanks for the investigation @donysukardi. All of my repos use husky and lint-staged and I've not experienced this problem before... 🤔

  7. donysukardi commented on Nov 3, 2017

    @donysukardi

    @kentcdodds You're right. Let me test it out on a more controlled repo with just this package.

  8. donysukardi commented on Nov 3, 2017

    @donysukardi

    @kentcdodds @jseminck I tested it against downshift with commit flag set to true and I got the same issue. The current git commit code doesn't play nicely with husky apparently.

  9. kentcdodds commented on Nov 3, 2017

    @kentcdodds
    Member

    Ah, thanks for finding that out! I never use that option which explains why I haven't had the problem. Honestly I don't personally care for that option at all, so I'd be more inclined to remove the option personally...

  10. donysukardi commented on Nov 3, 2017

    @donysukardi

    Agreed. It's a good-to-have, but can-live-without feature. Perhaps what we can do is to still keep the code and display message that manual commit is required when the commit command fails.

  11. machour commented on Nov 3, 2017

    @machour
    Contributor

    I discovered the commit feature yesterday while contributing to this repo and found it to be really confusing.

    +1 on removing it

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions