I get this message on terminal when docker-compose up -d –build
➜ InvoiceApp git:(main) ✗ docker-compose logs frontend
invoice_v2_react | yarn run v1.22.19
invoice_v2_react | $ react-scripts start
invoice_v2_react | /bin/sh: react-scripts: not found
invoice_v2_react | error Command failed with exit code 127.
invoice_v2_react | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
I thought my configuration is perfect
FROM node:20-alpine
# Ustaw katalog roboczy w kontenerze
WORKDIR /appreact
# Skopiuj plik package.json i yarn.lock (jeśli istnieje)
COPY ./appreact/package.json ./
COPY ./appreact/yarn.lock ./
# Zainstaluj zależności projektu
RUN yarn install
# Skopiuj pozostałe pliki projektu do katalogu roboczego
COPY ./appreact .
RUN yarn build
# Expose the port the app runs on
EXPOSE 3000
# Uruchom serwer deweloperski za pomocą react-scripts
CMD ["yarn", "start"]
I tried many configuration, it actually work, but looks ugly, we=hen I added globally in this file
yarn add globally react-scripts
do you have any suggestions?
New contributor
Konr Fth is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.