-
-
Notifications
You must be signed in to change notification settings - Fork 106
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
Bin conflict with gulp & gulp-cli #7
Comments
Is gulp-cli meant to be installed globally in the future? I'm wondering if both of them need the bin. I run into this issue in my slush fork: https://github.com/heikki/slush/tree/4.0 |
gulp-cli was meant to be installed globally but then aliased in gulp so when it is installed locally, you can easily do |
Whoops, didn't read this code yet. By making gulp-cli a dependency of gulp it should make gulp available in |
I'd be happy to use a workaround for this case. So far I have found only bad ones 😄
|
So, my previous assumptions were incorrect, but, @heikki why are you depending on both |
@tkellen I linked the slush fork above. I'm trying to modify Workaround is fine for me. I just thought to bring this up because I'd imagine ppl can get easily things messed. For example install both globally, then uninstall one and boom there's no bins anymore. Should this be closed as wontfix or is there alternatives left? |
Unfortunately, I think this is a wontfix, both because I think your particular implementation is enough of an edge case, and because I can't think of a good solution :/. |
cc @contra was going to close this but looks like I don't have privs here? Just checked for the gulp repo--same deal. |
@heikki I'd like a way to solve this but we really only have 2 options:
|
3 . Remove bin from Global install would be bigger but wouldn't it solve this issue? Am I overlooking something? |
It's a versioning thing. It will be confusing that gulp 3.whatever globally installed can run gulp 4.whatever but only if it is local. Having a separate (smaller being another benefit) module that is versioned separately makes that distinction easier. |
I agree. I'd still rather have that if it prevents breaking things accidentally. I usually install global modules without specifying version and occationally update all of them to latest and expect that things keep working. Random notes:
--edit Just noticed that 4.0 branch warnings are already different |
Currently, local/global already works as expected. You can still install gulp globally and have it work. That is the reason for the duplicate bin files. I don't like the hack to work with NODE_PATH because it will work when the bug in the |
Ahaa, wasn't aware of that. Looks like PR got rejected though. |
Hmm.. what about having bin only in Lol, let me know if that didn't make sense.. |
It makes sense but @tkellen suggested not to do that, as it was a pain point in grunt, which is what lead to the current implementation. |
I'm curious what kind of problems there were.
I'm probably reading this wrong but I don't understand the dependency part. At least I can't see direct dependencies in grunt / grunt-cli package.jsons. |
@heikki it is for the people that ONLY use npm scripts, like myself. It is a pain to install gulp and gulp-cli in my devDeps so I can use npm scripts |
That explains.. 😄 Can't get better (and more logical) cli separation than that. |
Looking into this more. I just attempted |
I would believe there's an issue here, and it would be a lot easier for me to get traction on establishing where the issue is if you could do me a solid and reduce the failure to a minimal test case. File an issue in the meantime, so I have something I can track. Thanks! It's worth pointing out that this will 100% be affected by the changes to the install in |
@othiym23 Is simple package.json ok for test case? https://gist.github.com/heikki/eae172b8d1c5a97ed5ef#file-package-json |
@heikki I can't get the attached |
@othiym23 on osx & |
@othiym23 was there a change in 2.2 that would cause this to not happen anymore? Also, the command |
I'm seeing this in 2.2 too. Mentioned in npm issue: npm/npm#7130 |
@phated while it seems nice to have both packages expose a bin/gulp.js, it might not be the wisest decision and also might oppose all best practices established so far. I would go for the standard way and have both a gulp-cli package that exposes the binary and a second API package that exposes the API. And since the tool/API is in a rather early stage of development I would simply go for it instead of waiting for the peops over at npm to fix the issue, considering their overall backlog and their current focus on enterprise level features and npm registry2 and what not. |
We are going to ship both. It is annoying to have to have something like gulp-cli in devDeps just to have access to the bin in your npm scripts |
@phated I disagree. Separation of concerns is a good thing. "one way of doing things" is too. |
@sindresorhus I don't care because @tkellen's advice was correct. I hate how grunt does it currently |
@silkentrance dude, it's already been quoted and linked in this thread. Locking. |
@heikki would you be able to test these use cases again but with npm 3.x? If npm3 has solved this (or at least gave us a determinate behavior), then I'd be good with shipping the CLI. |
I don't see Linked gulp bin varies: ∴ npm-install-bin-conflicts git:(master) ./enoent.sh
Running 'npm install gulp gulp-cli' repeatedly
install 1, gulp bin -> ../gulp-cli/bin/gulp.js
install 2, gulp bin -> ../gulp/bin/gulp.js
install 3, gulp bin -> ../gulp/bin/gulp.js
install 4, gulp bin -> ../gulp/bin/gulp.js
install 5, gulp bin -> ../gulp/bin/gulp.js
install 6, gulp bin -> ../gulp/bin/gulp.js
install 7, gulp bin -> ../gulp/bin/gulp.js
∴ npm-install-bin-conflicts git:(master) ./eexist.sh
Running 'rm -fr node_modules && npm install gulp gulp-cli' repeatedly
install 1, gulp bin -> ../gulp-cli/bin/gulp.js
install 2, gulp bin -> ../gulp-cli/bin/gulp.js
install 3, gulp bin -> ../gulp/bin/gulp.js
install 4, gulp bin -> ../gulp-cli/bin/gulp.js
install 5, gulp bin -> ../gulp-cli/bin/gulp.js
install 6, gulp bin -> ../gulp-cli/bin/gulp.js
install 7, gulp bin -> ../gulp-cli/bin/gulp.js
∴ ~ npm list -g
/Users/heikki/.nvm/versions/node/v0.12.7/lib
├── [email protected]
└── [email protected]
∴ ~ npm install -g gulp-cli
/Users/heikki/.nvm/versions/node/v0.12.7/bin/gulp -> /Users/heikki/.nvm/versions/node/v0.12.7/lib/node_modules/gulp-cli/bin/gulp.js
/Users/heikki/.nvm/versions/node/v0.12.7/lib
└── [email protected]
∴ ~ gulp -v
[15:10:14] CLI version 0.3.0
∴ ~ npm uninstall -g gulp
∴ ~ gulp -v
fish: Unknown command 'gulp' |
These both look like npm bugs to me– given the same module list it should be linking modules in the same order and apparently it isn't. And given that I'll open these as issues over on the npm tracker and link here. |
@iarna thank you so much! |
Hey you all, can any of you reproduce the "different install orders" thing with |
Yes, details here -> npm/npm#8995 (comment) |
The new npm is out, can we test and verify that this is fixed? |
@contra it isn't out yet. Should be out today, I think |
For reference, the version we want to test this against will be 3.3.1 (currently "next" is 3.3.0) |
Yup, 3.3.1 got bumped to next week for process reasons. If you already have 3.x installed somewhere, you can try out 3.3.1 by installing |
Install order looks consistent with Running 'npm install gulp gulp-cli' repeatedly
install 1, gulp bin -> ../gulp-cli/bin/gulp.js
install 2, gulp bin -> ../gulp-cli/bin/gulp.js
install 3, gulp bin -> ../gulp-cli/bin/gulp.js
install 4, gulp bin -> ../gulp-cli/bin/gulp.js
install 5, gulp bin -> ../gulp-cli/bin/gulp.js
install 6, gulp bin -> ../gulp-cli/bin/gulp.js
install 7, gulp bin -> ../gulp-cli/bin/gulp.js |
🎉 🎈 🎂 🎆 🍻 Closing this now. |
EDIT: actually even locally defining it doesn't give it precedence -.- |
Npm install fails when having gulp-cli as dependency and gulp as devDependency. This is probably because both of them try to link their own gulp bin.
The text was updated successfully, but these errors were encountered: