You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build an image with the dockerfile provided, but I keep getting the error 'sh: react-router: not found' during the RUN npm run build line in the dockerfile.
I don't know if it's relevant but I'm running Ubuntu Server 24.04.2 LTS.
Docker output in terminal:
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 639B 0.0s
=> [internal] load metadata for docker.io/library/node:20-alpine 0.9s
=> [internal] load .dockerignore 0.0s
=> => transferring context: 82B 0.0s
=> [internal] load build context 0.0s
=> => transferring context: 12.64kB 0.0s
=> CACHED [development-dependencies-env 1/4] FROM docker.io/library/node:20-alpine@sha256:d3507a213936fe4ef54760a186e113db5188472d9efdf491686 0.0s
=> [development-dependencies-env 2/4] COPY . /app 0.1s
=> [build-env 2/5] COPY . /app/ 0.1s
=> CACHED [production-dependencies-env 2/4] COPY ./package.json package-lock.json /app/ 0.0s
=> CACHED [production-dependencies-env 3/4] WORKDIR /app 0.0s
=> CACHED [production-dependencies-env 4/4] RUN npm ci --omit=dev 0.0s
=> CACHED [stage-3 3/5] COPY --from=production-dependencies-env /app/node_modules /app/node_modules 0.0s
=> [development-dependencies-env 3/4] WORKDIR /app 0.0s
=> [development-dependencies-env 4/4] RUN npm ci 141.0s
=> [build-env 3/5] COPY --from=development-dependencies-env /app/node_modules /app/node_modules 0.1s
=> [build-env 4/5] WORKDIR /app 0.0s
=> ERROR [build-env 5/5] RUN npm run build 5.4s
------
> [build-env 5/5] RUN npm run build:
0.424
0.424 > build
0.424 > react-router build
0.424
0.427 sh: react-router: not found
------
Dockerfile:15
--------------------
13 | COPY --from=development-dependencies-env /app/node_modules /app/node_modules
14 | WORKDIR /app
15 | >>> RUN npm run build
16 |
17 | FROM node:20-alpine
--------------------
ERROR: failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 127
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to build an image with the dockerfile provided, but I keep getting the error 'sh: react-router: not found' during the
RUN npm run build
line in the dockerfile.I don't know if it's relevant but I'm running Ubuntu Server 24.04.2 LTS.
Docker output in terminal:
Beta Was this translation helpful? Give feedback.
All reactions