[openstreetmap/openstreetmap-website] Yarn install broken - INSTALL.md out of date? (Issue #3579)

Andy Allan notifications at github.com
Wed Jan 4 21:34:53 UTC 2023


So thinking about this, there's two main options:

* Change the installation so that both a) a new enough version of node and b) a non-Ubuntu package of yarn is installed. For example, use nodesource for node 16+ and https://dl.yarnpkg.com/debian apt repository for yarn. This would resolve both the engines and the yarnpkg binary naming issues, and `bundle exec rails yarn:install` would then work.
* Alternatively, change the installation instructions to run `bundle exec bin/yarn install` instead. This way we can keep using the package name detection and keep ignoring the engines.

I lean towards the second option. This is to keep the installation as simple as possible. Since we can actually run everything we need for the site just fine with the versions of node and yarn that Ubuntu supply, even on 20.04, it seems unnecessary to make new developers jump through hoops of adding additional apt repositories. If they already have newer versions of node and/or yarn on their system, bin/yarn will still work fine for them too.

We would need to revisit this if/when we genuinely need a newer node engine, or at some point the stars will align and some future Ubuntu LTS release will have a `yarn` binary plus a new enough version of node for all of our packages. And at that point `bin/yarn` will be obsolete and we can go back to `bundle exec rails yarn:install`.

The one small wrinkle here is that one of our dev node packages, eslint, genuinely requires node 12+. It [was mentioned](https://github.com/openstreetmap/openstreetmap-website/issues/3275#issuecomment-1106929281) in April 2022, and was broken by the [upgrade to eslint 8.x](https://github.com/openstreetmap/openstreetmap-website/pull/3339) in October 2021. It wasn't picked up at the time, due to the whole "Github flavoured Ubuntu" thing which means that eslint still passes on Ubuntu 20.04 in CI. eslint will work with standard packages on Ubuntu 22.04, but not on Ubuntu 20.04. To fix this particular issue, a followup task will be to upgrade all our installations (INSTALL.md, Dockerfile, vagrant, etc) to 22.04.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3579#issuecomment-1371453162
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/issues/3579/1371453162 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230104/1b7cdeba/attachment.htm>


More information about the rails-dev mailing list