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

install gulp#v4.0.0-alpha.2 git damaged #2078

Closed
mice33 opened this issue Jan 1, 2018 · 26 comments
Closed

install gulp#v4.0.0-alpha.2 git damaged #2078

mice33 opened this issue Jan 1, 2018 · 26 comments

Comments

@mice33
Copy link

mice33 commented Jan 1, 2018

npm install gulpjs/gulp#6d71a65

npm ERR! code 1
npm ERR! Command failed: C:\Program Files\Git\cmd\git.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 Files\Git\cmd\git.EXE checkout 4.0
npm ERR! error: pathspec '4.0' did not match any file(s) known to git.
npm ERR!

@mice33
Copy link
Author

mice33 commented Jan 1, 2018

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

@Silic0nS0ldier
Copy link

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)

@ParaBolt
Copy link

ParaBolt commented Jan 1, 2018

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.

@Silic0nS0ldier
Copy link

@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?)

@ParaBolt
Copy link

ParaBolt commented Jan 1, 2018

@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.

@phated
Copy link
Member

phated commented Jan 2, 2018

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.

@phated phated closed this as completed Jan 2, 2018
@gulpjs gulpjs deleted a comment from sgangwisch Jan 2, 2018
@leptest
Copy link

leptest commented Jan 2, 2018

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!

@sgangwisch
Copy link

sgangwisch commented Jan 2, 2018

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 #2063 (comment).

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

Edit: gulp@next did not fix our issue

@phated
Copy link
Member

phated commented Jan 2, 2018

@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.

@phated
Copy link
Member

phated commented Jan 2, 2018

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

@leptest
Copy link

leptest commented Jan 2, 2018

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

@sgangwisch
Copy link

@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

@phated
Copy link
Member

phated commented Jan 2, 2018

@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.

@sgangwisch
Copy link

sgangwisch commented Jan 2, 2018

@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

@phated
Copy link
Member

phated commented Jan 2, 2018

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

@sgangwisch
Copy link

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

@leptest
Copy link

leptest commented Jan 2, 2018

Windows 10 (1709)

But as mentioned, fixed with gulp@next.

@phated
Copy link
Member

phated commented Jan 2, 2018

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.

@phated
Copy link
Member

phated commented Jan 2, 2018

Fixed it with a010db6 - 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

@Silic0nS0ldier
Copy link

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

@sgangwisch
Copy link

@phated 89acc5c worked for me

@daniel-chapman-eqtr
Copy link

Thanks for the help @phated!

@whereisaaron
Copy link

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.

Is gulpjs/gulp#v4.0.0 equivalent for now?

@phated
Copy link
Member

phated commented Oct 20, 2018

@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

@whereisaaron
Copy link

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.

@long20150122

This comment has been minimized.

@gulpjs gulpjs locked and limited conversation to collaborators Feb 23, 2019
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

9 participants