5 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
5 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
5 months ago
Hey there! We've found the following might help you get unblocked faster:
If you find the answer from one of these, please let us know by solving the thread!
5 months ago
None of the suggestions above is helping. can someone please provide a related solution?
5 months ago
Hey, can you provide more logs that may include hints to pinpoint what causes your application to not build?
5 months ago
hello @uxuz, kindly find the logs in the attached file
Attachments
5 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
5 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.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"]
5 months ago
okay
5 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
5 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-sassLet me know if this works!
5 months ago
okay let me do that
5 months ago
I have a feeling that this also may not work because of the lack of Yarn being installed...
5 months ago
it worked. thanks a lot for your help @loudbook
Status changed to Open uxuz • 5 months ago
Status changed to Solved uxuz • 5 months ago