Use yarn instead of npm in Makefile
Merge request reports
Activity
- Resolved by username-removed-636429
I think we should also update the GDK documentation to include instructions to install yarn and an appropriate version of nodejs? /cc: @mikegreiling
- Resolved by username-removed-636429
Thanks @rspeicher. This has been on my todo list for a while.
@stanhu yes we should, and if possible it would be nice to just have the GDK script check that node and yarn are both installed and at the correct minimum version (v4.3.0 for node, and v0.17.0 for yarn). It could show a helpful warning message if they are not, similar to our
rake yarn:available
task.assigned to @rspeicher
Ok. Figuring out/documenting how to get
yarn
installed on every supported platform is probably not something I'm going to take on right away, if ever, though.Edited by Robert SpeicherIt may also be useful to run
yarn check
prior to spinning up the dev server in the procfile. That waygdk run db
will fail with a more useful message if ayarn install
is necessary (similar to howgdk run app
gets preempted when bundler detects that a gem is missing. (This could be a separate MR though)Well the commands needed for this are already in our omnibus build images, so it may be a simple matter of copy/paste from there, or just pointing the user to https://yarnpkg.com/en/docs/install and letting them figure it out
see: https://gitlab.com/gitlab-org/gitlab-omnibus-builder/merge_requests/30/diffs for the commands we use to build with yarn on our supported platforms
So apparently the proper fix isn't as simple as this, so I'm not sure I'll have time to finish it properly. Are you able to take over @mikegreiling?
yeah, I can take over @rspeicher
assigned to @mikegreiling
I've added minimum version info and links to official installation guides for nodejs and yarn to the "requirements for all platforms" section of the
prepare.md
doc. I don't know if it would be worth the time to research installation instructions for every individual linux distribution (we haven't even done this for nodejs yet). I think this catch-all paragraph at the top should be good enough.I've also added a helpful error message for cases where yarn is not available while running
gdk install
orgdk update
.$ brew unlink yarn $ gdk update ... Error: Yarn executable was not detected in the system. Download Yarn at https://yarnpkg.com/en/docs/install make: *** [yarn] Error 1
I think this is enough sign-posting to prevent mass confusion when this MR goes in.
@jacobvosmaer-gitlab can you review/merge this?
assigned to @jacobvosmaer-gitlab
added 36 commits
- c0693f82...8e123b62 - 31 commits from branch
master
- b3f1b703 - Use yarn instead of npm in Makefile
- 83371d07 - add --pure-lockfile flag to ensure yarn does not modify yarn.lock when installing
- 18c15cb5 - check that yarn is installed and print a useful error message if not
- 01e5c762 - use yarn to run webpack-dev-server in Procfile
- d9fe0935 - add installation requirements for node and yarn to documentation
Toggle commit list- c0693f82...8e123b62 - 31 commits from branch
mentioned in merge request !290 (merged)
@mikegreiling Looks good to me!
assigned to @grzesiek
mentioned in commit f241da3e