<p></p>
<p dir="auto">There's two different issues discussed here, and while they are related they are not the same. <code class="notranslate">bundle exec rails yarn:install</code> failing to find yarn on Ubuntu is not the same issue as <code class="notranslate">The engine "node" is incompatible with this module.</code> for osm-community-index. The first is to do with package naming on Ubuntu, the second is to do with passing flags to yarn.</p>
<p dir="auto">The behaviour of <code class="notranslate">bundle exec rails yarn:install</code> <a href="https://github.com/rails/rails/pull/43641" data-hovercard-type="pull_request" data-hovercard-url="/rails/rails/pull/43641/hovercard">changed in Rails 7</a>, to directly call <code class="notranslate">yarn</code> instead of <code class="notranslate">bin/yarn</code>.</p>
<p dir="auto">This is important for two reasons, the first being that <code class="notranslate">bin/yarn</code> <a href="https://github.com/openstreetmap/openstreetmap-website/blob/52078b5d764b867c643728ed5839a2cfbd9c5a2c/bin/yarn#L6">detects whether to call <code class="notranslate">yarn</code> or <code class="notranslate">yarnpkg</code></a>.</p>
<p dir="auto">The second reason is that <code class="notranslate">bin/yarn</code> passes the <code class="notranslate">--ignore-engines</code> flag, and without that yarn will fail on osm-community-index or js-cookie, which <a href="https://github.com/openstreetmap/openstreetmap-website/issues/3275" data-hovercard-type="issue" data-hovercard-url="/openstreetmap/openstreetmap-website/issues/3275/hovercard">has an existing discussion</a>.</p>
<p dir="auto">It's interesting to investigate why this didn't break anything in CI (both tests and for Docker) or elsewhere, since it indicates inconsistencies between our installation instructions and what CI is actually doing.</p>
<ul dir="auto">
<li>For the CI tests - It calls <a href="https://github.com/openstreetmap/openstreetmap-website/blob/52078b5d764b867c643728ed5839a2cfbd9c5a2c/.github/workflows/tests.yml#L57"><code class="notranslate">bundle exec rails yarn:install</code></a>, so I would expect it to fail! However, the GithubCI version of Ubuntu <a href="https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2004-Readme.md#installed-software">has newer versions of node</a> installed, and presumably has a binary called <code class="notranslate">yarn</code> too. So although we are trying to test on "Ubuntu" it's more like "Github flavoured Ubuntu" rather than "actual Ubuntu" or "vagrant ubuntu/focal64 flavoured Ubuntu". Hence the discrepancies between CI and INSTALL.md.</li>
<li>For the Docker tests, this is more straightforward. The Dockerfile contains an explicit <a href="https://github.com/openstreetmap/openstreetmap-website/blob/52078b5d764b867c643728ed5839a2cfbd9c5a2c/Dockerfile#L50"><code class="notranslate">yarnpkg --ignore-engines install</code></a>, which still works (but is Ubuntu specific). I think that should be changed to line up with our installation instructions.</li>
<li>For production, OSMF <a href="https://github.com/openstreetmap/chef/blob/4e4da59c36d7727b244fedda27e97b11ae1e9a9e/cookbooks/nodejs/templates/default/yarn.erb">used to have a shim</a> so that <code class="notranslate">yarn</code> worked and <code class="notranslate">--ignore-engines</code> was always passed to yarn, but <a href="https://github.com/openstreetmap/chef/commit/cfa0fe92774c9dfcf0a0085d7772319550066ed7">are now using nodesource packages</a> to get both a binary called <code class="notranslate">yarn</code> and a new enough version of node that there are no engine warnings.</li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/3579#issuecomment-1371261751">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLKSIBIHPSV46OU6U5LWQW4YFANCNFSM5ZNUQ7OQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLNO2D534IBNWWMNZCLWQW4YFA5CNFSM5ZNUQ7O2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOKG54WNY.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/issues/3579/1371261751</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/issues/3579#issuecomment-1371261751",
"url": "https://github.com/openstreetmap/openstreetmap-website/issues/3579#issuecomment-1371261751",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>