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

Error with gulp while npm install #1322

Closed
derweili opened this issue Oct 30, 2018 · 7 comments
Closed

Error with gulp while npm install #1322

derweili opened this issue Oct 30, 2018 · 7 comments

Comments

@derweili
Copy link
Collaborator

Recently I get an error while running npm install.
Is error ist related to gulp.

How can this bug be reproduced?

  1. clone FoundationPress
  2. run npm install

What happened
While installing all npm dependencies I get following error:

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

    at ChildProcess.exithandler (child_process.js:198:12)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:920:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:230:5)

My Solution
I was able to solve this error by removing the #4.0 at the gulp devDependencies.

"gulp": "gulpjs/gulp#4.0",

Please List the Following:

  • OS & version: macOS 10.13.6
  • Node version (node -v) [Node v4+ is required] : v6.11.5 (installed via nvm)
  • FoundationPress version: 2.10.4
  • Foundation version : 6.4.3
@melek
Copy link

melek commented Oct 30, 2018

I also solved this issue manually, though I did it by replacing the line with:
"gulp": "^4.0",

I'm not proficient enough with npm to understand why both worked and which solution is the 'correct' one, but wanted to add my experience in case it informs a better bugfix.

@dantahoua
Copy link
Contributor

dantahoua commented Oct 31, 2018

Same here... Depending of the npm version (I use nvm), error is sightly different but always around this gulp 4.0... With node 6.11.5 I have:

npm ERR! git rev-list -n1 4.0: fatal: ambiguous argument '4.0': unknown revision or path not in the working tree.
npm ERR! git rev-list -n1 4.0: Use '--' to separate paths from revisions, like this:
npm ERR! git rev-list -n1 4.0: 'git <command> [<revision>...] -- [<file>...]'
npm ERR! git rev-list -n1 4.0: 
npm ERR! git rev-list -n1 4.0: fatal: ambiguous argument '4.0': unknown revision or path not in the working tree.
npm ERR! git rev-list -n1 4.0: Use '--' to separate paths from revisions, like this:
npm ERR! git rev-list -n1 4.0: 'git <command> [<revision>...] -- [<file>...]'
npm ERR! git rev-list -n1 4.0: 
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? yes
...
..
.
npm ERR! node v6.11.5
npm ERR! npm  v3.10.10
npm ERR! code 128

npm ERR! Command failed: git clone --template=/Users/studio12/.npm/_git-remotes/_templates --mirror [email protected]:gulpjs/gulp.git /Users/studio12/.npm/_git-remotes/git-github-com-gulpjs-gulp-git-4-0-7c06e801
npm ERR! Cloning into bare repository '/Users/studio12/.npm/_git-remotes/git-github-com-gulpjs-gulp-git-4-0-7c06e801'...
npm ERR! Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
npm ERR! [email protected]: Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR! 
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.

Seems the repository is not here, or an access problem/authorization...

Note that using the command npm install 'gulpjs/gulp.git#4.0' --save-dev ends up withthe same error...

From the last comment on this issue, seems the 4.0 branch is no more there... :(
https://github.com/gulpjs/gulp/issues/2078

@dantahoua
Copy link
Contributor

dantahoua commented Oct 31, 2018

I found it after reading this post on the Gulp GIT : https://github.com/gulpjs/gulp/issues/1486
Yo have to replace the gulp line in package.json with
"gulp": "next",
Note that even if it's working I still have also Failed to load external module @babel/register message when starting with npm start. Babel-register is installed, don't understand this one...
If using node 8.12, no problem with Babel-register.
Maybe a pullrequest to correct the package.json? I'm not able to make the pull request...

dantahoua added a commit to dantahoua/FoundationPress that referenced this issue Oct 31, 2018
Change version of Gulp for install regarding issue olefredrik#1322
@neilwave
Copy link

neilwave commented Nov 2, 2018

Same here:

npm install
following error:

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

at ChildProcess.exithandler (child_process.js:275:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Socket.stream.socket.on (internal/child_process.js:346:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:554:12)`

OS ElCapitan 10.11.6
Node v.8.9.4
Foundation Press Version: 2.10.4

@derweili
Copy link
Collaborator Author

derweili commented Nov 2, 2018

I found it after reading this post on the Gulp GIT : https://github.com/gulpjs/gulp/issues/1486
Yo have to replace the gulp line in package.json with
"gulp": "next",

I don't think "next" is the right version to reference. "next" does not reference to a unique version but to the latest stable version. This version will change in the future.
Using "next" could cause incompatibility problems when gulp has breaking changes in upcoming versions.

That's why i prefer @melek's solutions:

I also solved this issue manually, though I did it by replacing the line with:
"gulp": "^4.0",

@neilwave
Copy link

neilwave commented Nov 3, 2018

I tested an older installation i had (same Foundation Press Version, 2.10.4), just copied all files into the new folder were i had the Unhandled rejection Error before and npm start, npm build are running well.
package.json: line 42: "gulp": "gulpjs/gulp#4.0", is unchanged.

But that can´t be the solution.

Next try:
I overlocked that my current node version was higher than recommended, so i downgraded it to 6.11.5.
Changed package.json "gulp": "^4.0" (like @melek)

now it´s running

@olefredrik
Copy link
Owner

#1327

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

No branches or pull requests

5 participants