Gulp: install gulp#v4.0.0-alpha.2 git damaged

Created on 1 Jan 2018  路  26Comments  路  Source: gulpjs/gulp

npm install gulpjs/gulp#6d71a65

npm ERR! code 1
npm ERR! Command failed: C:Program FilesGitcmdgit.EXE checkout 6d71a65
npm ERR! error: Your local changes to the following files would be overwritten by checkout:
npm ERR! docs/why-use-pump/pipe-error.png
npm ERR! docs/why-use-pump/pump-error.png
npm ERR! Please commit your changes or stash them before you switch branches.
npm ERR! Aborting
npm ERR!


npm install gulpjs/gulp#430df36

npm ERR! code 1
npm ERR! Command failed: C:Program FilesGitcmdgit.EXE checkout 4.0
npm ERR! error: pathspec '4.0' did not match any file(s) known to git.
npm ERR!

Most helpful comment

When it stopped working for me, I had gulp installed like
"gulp": "git://github.com/gulpjs/gulp.git#6d71a658c61edb3090221579d8f97dbe086ba2ed"

All 26 comments

I want to install v4.0.0-alpha.2, what should I do

Same on my end. Can confirm this isn't an NPM issue either, as other repos work fine.

I don't have a solution, but in the meantime I have an alternative. As of around 5 hours ago v4 was released on NPM with the next tag, so you could simple pull direct from NPM with npm install gulp@next. (ref https://twitter.com/gulpjs/status/947642181631721472)

I had to delete package-lock.json on my repo to solve the problem. For me the lockfile did not matter since I wanted the latest of all packages anyways.

@ParaBolt Really? I replicated this immediately after npm init, so there was no lock file. I've eliminated the existance of node_modules as a factor too, it makes no difference.

Huh. Heres a thought. 4.0 is now on master, and no doubt there were merge conflicts given how long it was in development. Could it be possible that this has been caused by caching? (something untouched by npm cache clean --force?)

@Silic0nS0ldier : Reverting to the old package-lock.json and reinstalling brings back the issue for me. I had tried cleaning the cache and even using an older version of node but the problem still persisted.

I guess deleting the lockfile made npm download the latest release rather than the mentioned alpha build which might be the broken one.

Edit : Indeed, I have installed the @next tagged version.

The crux of this is you having an incorrect expectation about what version of "gulp 4" you were using when installing with gulpjs/gulp#4.0. The typical development cycle is "work on thing in branch until it is ready for a release" -> "version bump" -> "make available for consumption". The changes in that release are every commit BEFORE the release, not after.

That being said, gulp 4 has been in alpha for a long time due to backlogged breaking changes and the version bump for "alpha.2" was very long ago and depended on either master branches of repositories or repositories that existed on other organizations and got shuffled around. What people were treating as "alpha.2" was actually an experimental version that could probably be identified as "alpha 2.5" because it switched to using published modules instead of master branches as we worked out the other kinks.

Once those were worked out, we "version bumped" the alpha.3 version that people had trouble with but pretty quickly went to work updating the ecosystem and landed a patch in vinyl-fs as a temporary fix. That "alpha.3" release actually contains everything you thought was "alpha.2" but it also landed more breaking changes to the underlying libraries (notice that this release is every commit BEFORE the release, not after).

In the 4.0.0 official release, we rebased the 4.0 branches' history because it and master had become very separated and we wanted a clean merged onto master - this was done in a completely separate branch (leaving the 4.0 branch intact). We also upgraded our changelog system to the conventional-changelog system (as with all our other repositories) which allowed us to split the individual alpha "releases" into separate git tags with their own changelogs. We thought this would allow people to install from tags using gulpjs/gulp#v4.0.0-alpha.1, gulpjs/gulp#v4.0.0-alpha.2 & gulpjs/gulp#v4.0.0-alpha.3 but after reviewing the "alpha.1" and "alpha.2" releases, we removed those installation suggestions from the README because they weren't able to be installed successfully with npm (due to the reasons mentioned above).

Due to those alpha tags being unable to be installed, we've left the 4.0 branch intact for now so people that relied on those commit hashes or using gulpjs/gulp#4.0 to install gulp 4 could still do some until they got the chance to upgrade to the published version of 4.0.0 on npm using npm install gulp@next.

Based on the issue title, it seems like you are running npm install gulpjs/gulp#v4.0.0-alpha.2 which won't work, as outlined above. If you are trying to install with a commit hash (why are you doing that when 4.0.0 is published and should have a temporary fix for the issues people were seeing?), then I'm not sure what npm is doing to your cache but you should force a cache clean.

@sgangwisch I can't help you because that solution is insane. Going to remove your comment so others don't try that.

I'm getting the same issue here. (I recently switched to the 6d71a65 commit because the latest 4.0 was breaking my project.)

Tried similar things like deleting node_modules, clearing cache, and removing package-lock.json but no luck.

Switching to gulp@next (and upgrading all my other packages) got things working again.

@phated Thank you for the very thorough explanation! Can't say I quite understand it all :P. But I can say that I'm excited to see some gulp 4 movement!

This doesn't fix the issue (premature close) that we were having... Our code only works with 4 alpha 2. Thus the reason we had to do this... you also suggested this in another post https://github.com/gulpjs/gulp/issues/2063#issuecomment-353427490.

We also had it pegged to commit 6d71a65 like was suggested before (https://github.com/gulpjs/gulp/issues/2065), when gulp-js#4.0.0-alpha... looks like that comment was deleted in there.

Edit: gulp@next did not fix our issue

@sgangwisch that commit hash still exists, look at the 4.0 branch. Your problem exists with npm, I don't know what they're screwing up internally.

@sgangwisch can you please provide your entire gulpfile in a brand new issue so I can see what is causing your premature close

When it stopped working for me, I had gulp installed like
"gulp": "git://github.com/gulpjs/gulp.git#6d71a658c61edb3090221579d8f97dbe086ba2ed"

@phated Here's the error that occurs when running npm install pegged to that commit

npm ERR! git checkout 6d71a658c61edb3090221579d8f97dbe086ba2ed: error: Your local changes to the following files would be overwritten by checkout:
npm ERR! git checkout 6d71a658c61edb3090221579d8f97dbe086ba2ed:     docs/why-use-pump/pipe-error.png
npm ERR! git checkout 6d71a658c61edb3090221579d8f97dbe086ba2ed:     docs/why-use-pump/pump-error.png
npm ERR! git checkout 6d71a658c61edb3090221579d8f97dbe086ba2ed: Please commit your changes or stash them before you switch branches.
npm ERR! git checkout 6d71a658c61edb3090221579d8f97dbe086ba2ed: Aborting
npm ERR! git checkout 6d71a658c61edb3090221579d8f97dbe086ba2ed: 
npm ERR! code 1
npm ERR! Command failed: git checkout 6d71a658c61edb3090221579d8f97dbe086ba2ed

@sgangwisch the npm log doesn't help me, I don't understand their internals. Maybe go open that with them? I still want to see your gulpfile to understand which plugins are busted.

@phated I'll have to provide that later as I'm not at my work machine.

I'll try to troubleshoot it before opening another issue with my gulpfile

Is this issue only happening with Windows users? I think it might be related to our gitattribute change. Maybe it's trying to convert the line endings upon clone and then it can't checkout

Nope... I'm on a Mac and see it

Windows 10 (1709)

But as mentioned, fixed with gulp@next.

It looks like the gitattributes stuff is to blame for this but if you were relying on 6d71a65 - just replace it with 89acc5c (the rebased hash for that commit). I'm going to keep poking at the gitattribute stuff.

Fixed it with https://github.com/gulpjs/gulp/commit/a010db615fae4fbf8ecfdaff5530a4d84107d984 - had to let git know that .png and .jpg files were binary and not to touch their line endings.

__Though, I highly recommend you upgrade to the published version using npm install gulp@next__

I suspected this had something to do with git... All good on my end.

@phated 89acc5c worked for me

Thanks for the help @phated!

Removing '4.0' broke a lot of stuff 馃槥

And using glup@next with the current version of npm fails due the the @:
`` $ npm --version 6.4.1 $ npm install gulp@next Unhandled rejection Error: Invalid tag name "gulp@next": Tags may not have any characters that encodeURIComponent encodes. ```` Isgulpjs/gulp#v4.0.0` equivalent for now?

@whereisaaron we've left that stale branch around for 10 months - it's time to upgrade, we've even updated our API docs and getting started guide to help with your migration. I'm not sure what's messed up with your npm install but everyone uses tags like that. You'll have to look somewhere else for the solution to that issue.

Edit: Screenshot of npm 6.4.1 working on a properly configured environment
screen shot 2018-10-20 at 12 35 13 am

Thanks @phated, I was not thinking to keep the branch, just to dual tag that release with the old and the new scheme, ie. '4.0' and 'v4.0.0'. Once you've had a stable version number in use for more than a year, I think it should stay around. The same way you have 'v3.8.1' etc. but still kept the old '3.8'.

I fixed the weird npm invalid tag error by deleting the packages-lock.json.

When it stopped working for me, I had gulp installed like
"gulp": "git://github.com/gulpjs/gulp.git#6d71a658c61edb3090221579d8f97dbe086ba2ed"
I try to use "gulp": "git://github.com/gulpjs/gulp.git#6d71a658c61edb3090221579d8f97dbe086ba2ed" but fail. I try to use gulpjs/gulp#v4.0.0-alpha.3 is ok.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cgc picture cgc  路  3Comments

yapcheahshen picture yapcheahshen  路  5Comments

lgg picture lgg  路  3Comments

amio picture amio  路  3Comments

XaBerr picture XaBerr  路  3Comments