R
Railway16mo ago
intro

How do I hook up my frontend correctly./

I am able to deploy my backend but my frontend is not working yet. Error:
#8 [4/5] RUN npm run build



#8 0.318 /bin/bash: line 1: npm: command not found

#8 ERROR: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 127

-----

> [4/5] RUN npm run build:

0.318 /bin/bash: line 1: npm: command not found

-----



Dockerfile:15

-------------------

13 | # build phase

14 | COPY . /app/.

15 | >>> RUN npm run build

16 |

17 |

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 127



Error: Docker build failed
#8 [4/5] RUN npm run build



#8 0.318 /bin/bash: line 1: npm: command not found

#8 ERROR: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 127

-----

> [4/5] RUN npm run build:

0.318 /bin/bash: line 1: npm: command not found

-----



Dockerfile:15

-------------------

13 | # build phase

14 | COPY . /app/.

15 | >>> RUN npm run build

16 |

17 |

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 127



Error: Docker build failed
15 Replies
Percy
Percy16mo ago
Project ID: 3b4c3c14-6b11-4e8a-8f52-bb11ff2f2554
intro
introOP16mo ago
3b4c3c14-6b11-4e8a-8f52-bb11ff2f2554
intro
introOP16mo ago
GitHub
GitHub - hannarosenfeld/vault-manager
Contribute to hannarosenfeld/vault-manager development by creating an account on GitHub.
Brody
Brody16mo ago
refresh me please, screenshot of your railway project?
intro
introOP16mo ago
Brody
Brody16mo ago
do you have the root directory set to /frontend?
intro
introOP16mo ago
Brody
Brody16mo ago
and if you have any build or start commands set in the service settings, please clear them
intro
introOP16mo ago
yes sorry i just saw i didn't it must have not saved. set it to /frontend now cleared build / start commands
Brody
Brody16mo ago
please copy the Caddyfile and nixpacks.toml files from this repo https://github.com/brody192/create-react-app-starter into your frontend folder
intro
introOP16mo ago
ok done and pushed. redeploying now
#19 ERROR: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1

-----

> [stage-0 12/15] RUN --mount=type=cache,id=s/fbd4d67e-9585-4de6-87a7-920ec77582e8-node_modules/cache,target=/app/node_modules/.cache npm run build:

14.21 Line 4:3: 'BrowserRouter' is defined but never used no-unused-vars

14.21 Line 7:3: 'Navigate' is defined but never used no-unused-vars

14.21 Line 15:8: 'Navigation' is defined but never used no-unused-vars

14.21 Line 31:6: React Hook useEffect has a missing dependency: 'isLoaded'. Either include it or remove the dependency array react-hooks/exhaustive-deps

14.21 Line 33:9: 'sessionUser' is assigned a value but never used no-unused-vars

14.21

14.21 src/store/index.js

14.21 Line 5:8: 'logger' is defined but never used no-unused-vars

14.21

14.21

-----



Dockerfile:30

-------------------

28 | # build phase

29 | COPY . /app/.

30 | >>> RUN --mount=type=cache,id=s/fbd4d67e-9585-4de6-87a7-920ec77582e8-node_modules/cache,target=/app/node_modules/.cache npm run build

31 |

32 | # fmt phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1



Error: Docker build failed
#19 ERROR: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1

-----

> [stage-0 12/15] RUN --mount=type=cache,id=s/fbd4d67e-9585-4de6-87a7-920ec77582e8-node_modules/cache,target=/app/node_modules/.cache npm run build:

14.21 Line 4:3: 'BrowserRouter' is defined but never used no-unused-vars

14.21 Line 7:3: 'Navigate' is defined but never used no-unused-vars

14.21 Line 15:8: 'Navigation' is defined but never used no-unused-vars

14.21 Line 31:6: React Hook useEffect has a missing dependency: 'isLoaded'. Either include it or remove the dependency array react-hooks/exhaustive-deps

14.21 Line 33:9: 'sessionUser' is assigned a value but never used no-unused-vars

14.21

14.21 src/store/index.js

14.21 Line 5:8: 'logger' is defined but never used no-unused-vars

14.21

14.21

-----



Dockerfile:30

-------------------

28 | # build phase

29 | COPY . /app/.

30 | >>> RUN --mount=type=cache,id=s/fbd4d67e-9585-4de6-87a7-920ec77582e8-node_modules/cache,target=/app/node_modules/.cache npm run build

31 |

32 | # fmt phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1



Error: Docker build failed
Brody
Brody16mo ago
you have a bunch of warnings and they are being treated as errors, you have two options, fix the warnings, or ignore the warnings and fix them later
intro
introOP16mo ago
I'll fix them later, they are referencing things I will use later
Brody
Brody16mo ago
gotcha, set a service variable CI = false
intro
introOP16mo ago
done, getting this error now:
#18 ERROR: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1

-----

> [stage-0 12/15] RUN --mount=type=cache,id=s/fbd4d67e-9585-4de6-87a7-920ec77582e8-node_modules/cache,target=/app/node_modules/.cache npm run build:

18.68 Line 4:3: 'BrowserRouter' is defined but never used no-unused-vars

18.68 Line 7:3: 'Navigate' is defined but never used no-unused-vars

18.68 Line 15:8: 'Navigation' is defined but never used no-unused-vars

18.68 Line 31:6: React Hook useEffect has a missing dependency: 'isLoaded'. Either include it or remove the dependency array react-hooks/exhaustive-deps

18.68 Line 33:9: 'sessionUser' is assigned a value but never used no-unused-vars

18.68

18.68 src/store/index.js

18.68 Line 5:8: 'logger' is defined but never used no-unused-vars

18.68

18.68

-----



Dockerfile:30

-------------------

28 | # build phase

29 | COPY . /app/.

30 | >>> RUN --mount=type=cache,id=s/fbd4d67e-9585-4de6-87a7-920ec77582e8-node_modules/cache,target=/app/node_modules/.cache npm run build

31 |

32 | # fmt phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1



Error: Docker build failed
#18 ERROR: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1

-----

> [stage-0 12/15] RUN --mount=type=cache,id=s/fbd4d67e-9585-4de6-87a7-920ec77582e8-node_modules/cache,target=/app/node_modules/.cache npm run build:

18.68 Line 4:3: 'BrowserRouter' is defined but never used no-unused-vars

18.68 Line 7:3: 'Navigate' is defined but never used no-unused-vars

18.68 Line 15:8: 'Navigation' is defined but never used no-unused-vars

18.68 Line 31:6: React Hook useEffect has a missing dependency: 'isLoaded'. Either include it or remove the dependency array react-hooks/exhaustive-deps

18.68 Line 33:9: 'sessionUser' is assigned a value but never used no-unused-vars

18.68

18.68 src/store/index.js

18.68 Line 5:8: 'logger' is defined but never used no-unused-vars

18.68

18.68

-----



Dockerfile:30

-------------------

28 | # build phase

29 | COPY . /app/.

30 | >>> RUN --mount=type=cache,id=s/fbd4d67e-9585-4de6-87a7-920ec77582e8-node_modules/cache,target=/app/node_modules/.cache npm run build

31 |

32 | # fmt phase

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 1



Error: Docker build failed
Want results from more Discord servers?
Add your server