React app build error
ellyyiga
PROOP

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

Solved$10 Bounty

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

Railway
BOT

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!


ellyyiga
PROOP

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?


ellyyiga
PROOP

5 months ago

hello @uxuz, kindly find the logs in the attached file

Attachments


5 months ago

Are you using a Dockerfile? Is this project open source?


ellyyiga
PROOP

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"]

ellyyiga
PROOP

5 months ago

okay


ellyyiga
PROOP

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-sass

Let 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!

ellyyiga
PROOP

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...


ellyyiga
PROOP

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


Loading...