8 months ago
I have 2 separate react apps (A and B) on different railway accounts with exactly the same package.json content. App A builds successfully without any build errors. however on builiding app B, the following error shows
ERROR: failed to build: failed to solve: process "yarn install --check-cache" did not complete successfully: exit code: 1
Can someone please help me rectify this problem
Pinned Solution
8 months ago
Please make a file named Dockerfile in the root directory of the repository and put the following in it.
FROM node:lts-alpine
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
COPY yarn.lock ./
RUN yarn add node-sass
RUN yarn
COPY . ./
CMD ["yarn", "start"]13 Replies
8 months ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 cant build react project, need more updated node version
- 🧵 Build failure, Api em node.js banco mySQL
- 🧵 failed to solve: process "bun install --frozen-lockfile" did not complete successfully: exit code: 1
If you find the answer from one of these, please let us know by solving the thread!
8 months ago
None of the suggestions above is helping. can someone please provide a related solution?
8 months ago
Hey, can you provide more logs that may include hints to pinpoint what causes your application to not build?
8 months ago
hello @uxuz, kindly find the logs in the attached file
Attachments
8 months ago
am not using docker file. am letting railway handle the deployment
ellyyiga
am not using docker file. am letting railway handle the deployment
8 months ago
Please make a file named Dockerfile in the root directory of the repository and put the following in it.
FROM node:lts-alpine
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY package.json ./
COPY yarn.lock ./
RUN yarn add node-sass
RUN yarn
COPY . ./
CMD ["yarn", "start"]samgordon
Please make a file named `Dockerfile` in the root directory of the repository and put the following in it. ```dockerfile FROM node:lts-alpine WORKDIR /app ENV PATH /app/node_modules/.bin:$PATH COPY package.json ./ COPY yarn.lock ./ RUN yarn add node-sass RUN yarn COPY . ./ CMD ["yarn", "start"] ```
8 months ago
okay
8 months ago
am now getting this error. checkout the logs in the attachment
Attachments
ellyyiga
am now getting this error. checkout the logs in the attachment
8 months ago
Oh, sorry I needed that for my project. You don't need it for yours.
You can entirely remove the following line:
RUN yarn add node-sassLet me know if this works!
samgordon
Oh, sorry I needed that for my project. You don't need it for yours. You can entirely remove the following line: ``` RUN yarn add node-sass ``` Let me know if this works!
8 months ago
okay let me do that
8 months ago
I have a feeling that this also may not work because of the lack of Yarn being installed...
8 months ago
it worked. thanks a lot for your help @loudbook
Status changed to Open uxuz • 8 months ago
Status changed to Solved uxuz • 8 months ago