-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Preinstall check that mentions 'yarn kbn' #16572
Conversation
@@ -0,0 +1,32 @@ | |||
const isUsingNpm = process.env.npm_config_git !== undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I searched around, this seemed like the simplest way to know it was npm
and not yarn
. E.g. from yarn team lead: https://twitter.com/cpojer/statuses/953286334013231104
Holy hacks. If this were a production thing, I'd say we need integration tests for all of these different possible scenarios, but it's not, and it never will be, so we're probably fine. |
It'd be good to test this on macos/linux/windows to ensure our expectations around the process contents are the same across OSs. |
I've tested macos. @azasypkin Can you test this on Linux? (btw, @marius-dr, if you don't have |
And we should verify that adding/removing dependencies doesn’t trigger a warning. Not sure if that triggers a preinstall |
It triggers the |
I think the warnings are very helpful. Thanks @kjbekkelund |
OS: Arch Linux Test case №1: node v8.9.4 / npm v5.6.0 Test case №2: node v8.9.4 / npm v5.6.0
Test case №3: node v8.9.4 / npm v5.6.0 |
Thanks for testing. I added a clarification around the npm3 (expected) failure in the description now too. |
💚 Build Succeeded |
💚 Build Succeeded |
NPM 3:
NPM 5:
Yarn:
Yarn kbn bootstrap:
and it goes on to work. LGTM |
Some preinstall checks to help people remember
yarn kbn bootstrap
.This also throws when using npm. However, it's a bit annoying that npm<5 runs this lifecycle hook after installing deps (and npm 3 doesn't allow our
link:
deps, so it will likely fail when installing deps). But at least it warns at the right time for npm5+.Test cases:
Unsupported URL Type
error, so it's not necessary to test it)npm install
. It should throw an error about using Yarn instead.yarn
and verify you see a message about preferring to useyarn kbn bootstrap
yarn kbn bootstrap
and verify no warningsTested on: