Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

Unhandled rejection Error: Command failed: /usr/bin/git checkout [email protected] #1316

Open
asmundsollihogda opened this issue Oct 23, 2018 · 16 comments
Labels
build error Error with the build process

Comments

@asmundsollihogda
Copy link

Hi! Thanks for great work. I have problems with installing NPM and think that it might be since updating macOS.

How can this bug be reproduced?

  1. Install foundationpress
  2. run npm install

What happened instead?

Unhandled rejection Error: Command failed: /usr/bin/git checkout [email protected]
error: pathspec '4.0' did not match any file(s) known to git.

at ChildProcess.exithandler (child_process.js:289:12)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:962:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)
  • OS & version: macOS 10.14
  • Node version (node -v) [Node v4+ is required] : v10.12.0
  • FoundationPress version (see line 3 in package.json): 2.10.4
  • Foundation version (found in node_modules/foundation-sites/package.json) :
@prahladmishra
Copy link

prahladmishra commented Oct 23, 2018

I am getting the same error, I am on windows.

@RonEarl
Copy link

RonEarl commented Oct 23, 2018

I posted the same issue a little big ago.

Frustrating. I think it's an issue getting the correct version of Gulp checked out.

-Ron

@DeiCha
Copy link

DeiCha commented Oct 23, 2018

I've already posted solution: #1312
FIX:
update package.json line 42
from "gulp": "gulpjs/gulp#4.0", to "gulp": "4.0"

@RonEarl
Copy link

RonEarl commented Oct 23, 2018

Hi DeiCha,

That did not work for me. I got the same error.

-Ron

@DeiCha
Copy link

DeiCha commented Oct 24, 2018

Strange, maybe package-lock.json din't updated when you've changed your package.json file.

If I were you I should try:

  • change package.json
  • npm rm -rf node_modules (to delete packages if some of them installed)
  • delete: package-lock.json
  • try npm init and npm install again

When solving my problem I've tried:

  • clean cache (npm cache clean --force).
  • reinstall git completely

Hope something helps. When googling about this I came to branch conflict problems. But i don't think it's the case when you do clean install.

@asmundsollihogda
Copy link
Author

Reinstalling git as a clean install and changing:
package.json line 42 from "gulp": "gulpjs/gulp#4.0", to "gulp": "4.0"
...helped me solve this problem.

Thank you for your help! @DeiCha

@michalchovanak
Copy link

changing "gulp": "gulpjs/gulp#4.0", to "gulp": "4.0" helped me, thank you!

@Pixelsmith
Copy link

I ran into the same wall that @RonEarl did. I'm a certified N00b, but the current version of the theme on Github comes with package-lock.json pre-installed, even though I'm not seeing it listed on the file list on Github.

If I make @DeiCha 's change on line 42 and delete the package-lock.json file then I can get NPM install to work, and the package-lock.json reappears after install.

I'm using git clone via Windows command line to install the theme, but I can't imagine why that'd auto-create the package-lock.json file.

@mrlescodes
Copy link

Thanks @DeiCha, changing "gulp": "gulpjs/gulp#4.0", to "gulp": "4.0" worked for me too

@BakaloMykhailo
Copy link

Thanks @DeiCha, changing "gulp": "gulpjs/gulp#4.0", to "gulp": "4.0" works

@LilyReile
Copy link

I believe what happened is that the gulpjs team deleted the branch 4.0 when they released that version as a package. @DeiCha 's fix targets that release instead of the git branch directly.

@neilwave
Copy link

neilwave commented Nov 3, 2018

  • OS & version: macOS 10.14
  • Node version (node -v) [Node v4+ is required] : v10.12.0

On Mac OS X El Capitan 10.11.6
I had the same issue using node version 10.x

I am not an expert, but when i get it right version 6.11.x is recommended as highest version:
https://github.com/olefredrik/FoundationPress#requirements

I downgraded node to 6.11.5

sudo npm cache clean -f
sudo npm install -g n
sudo n 6.11.5

changed package.json line 42: "gulp": "^4.0",

and it works (for me)

@riverus-dev
Copy link

Thanks @DeiCha changing "gulp": "gulpjs/gulp#4.0", to "gulp": "4.0" helped me, thank you!

vqoph pushed a commit to vqoph/vue-snotify that referenced this issue Nov 19, 2018
fix following error on npm install:
Error, Unhandled rejection Error: Command failed: /usr/local/bin/git checkout
error: pathspec '4.0' did not match any file(s) known to git.
error on gulp version see olefredrik/FoundationPress#1316
vqoph pushed a commit to vqoph/vue-snotify that referenced this issue Nov 20, 2018
fix following error on npm install:
Error, Unhandled rejection Error: Command failed: /usr/local/bin/git checkout
error: pathspec '4.0' did not match any file(s) known to git.
error on gulp version see olefredrik/FoundationPress#1316
@millturnK
Copy link

You shouldn't need to downgrade node. All I did was this and it amended my package and package-lock files appropriately:
npm install gulp@next --save

@zamson
Copy link

zamson commented Nov 26, 2018

I had to run rm package-lock.json and then it worked.

@alexander-young
Copy link

The reference to gulpjs/gulp#4.0 wasn't in the package.json but it was still in the package-lock.json and had to delete it out of there and then re-install the packages.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
build error Error with the build process
Projects
None yet
Development

No branches or pull requests