lib/generators/templates/_install_node.erb in dockerfile-rails-0.4.6 vs lib/generators/templates/_install_node.erb in dockerfile-rails-0.4.7

- old
+ new

@@ -15,7 +15,16 @@ RUN curl -fsSL https://fnm.vercel.app/install | bash && \ /root/.local/share/fnm/fnm install $NODE_VERSION ENV PATH=/root/.local/share/fnm/aliases/default/bin/:$PATH <% end -%> <% if yarn_version -%> +<% if yarn_version < '2' -%> RUN npm install -g yarn@$YARN_VERSION +<% else -%> +<% if (node_version.split('.').map(&:to_i) <=> [16,10,0]) < 0 -%> +RUN npm i -g corepack && \ +<% else -%> +RUN corepack enable && \ +<% end -%> + corepack prepare yarn@$YARN_VERSION --activate +<% end -%> <% end -%> \ No newline at end of file