Я хочу добавить Yarn в Image, однако выдаёт ошибку. Я обновил node и npm до последний, не помогло
FROM node:22.2.0
WORKDIR /app
RUN npm install -g npm@10.8.0
RUN npm i -g yarn
RUN yarn
Ошибка:
> [4/5] RUN npm i -g yarn:
1.374 npm error code EEXIST
1.374 npm error path /usr/local/bin/yarn
1.374 npm error EEXIST: file already exists
1.374 npm error File exists: /usr/local/bin/yarn
1.374 npm error Remove the existing file and try again, or run npm
1.375 npm error with --force to overwrite files recklessly.
1.378 npm error A complete log of this run can be found in: /root/.npm/_logs/2024-05-24T19_56_30_702Z-debug-0.log
------
Dockerfile:6
--------------------
4 | # COPY . .
5 | RUN npm install -g npm@10.8.0
6 | >>> RUN npm i -g yarn
7 | RUN yarn
8 | # COPY package*.json .
--------------------
ERROR: failed to solve: process "/bin/sh -c npm i -g yarn" did not complete successfully: exit code: 1
View build details: docker-desktop://dashboard/build/default/default/agl37y6vy4lo7imifnoox48vm
make: *** [Makefile:2: build] Error 1