igli
igli
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
@Brody if you have any ideas, can you please help me. I've been stuck on this for 3 days now
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
Hey @Brody how does this look to you. I need this cputil to be executable in my server. But when i try to use it in production in my node js server it says that the command doesn't exist
[phases.setup]
aptPkgs = ['...', 'wget', 'libicu-dev', "libssl-dev"]
cmds = [
"wget https://star-m.jp/products/s_print/CloudPRNTSDK/cputil/cputil-linux-x64_v112.tar.gz -O /tmp/cputil.tar.gz",
"tar -xzf /tmp/cputil.tar.gz -C /opt",
"rm /tmp/cputil.tar.gz",
"chmod +x /opt/cputil-linux-x64/cputil",
"export PATH=/opt/cputil-linux-x64:$PATH",
"echo $PATH",
"ls /opt/cputil-linux-x64"
]

[environment]
PATH = "/opt/cputil-linux-x64:$PATH"

[phases.build]
cmds = [
"cputil help"
]
[phases.setup]
aptPkgs = ['...', 'wget', 'libicu-dev', "libssl-dev"]
cmds = [
"wget https://star-m.jp/products/s_print/CloudPRNTSDK/cputil/cputil-linux-x64_v112.tar.gz -O /tmp/cputil.tar.gz",
"tar -xzf /tmp/cputil.tar.gz -C /opt",
"rm /tmp/cputil.tar.gz",
"chmod +x /opt/cputil-linux-x64/cputil",
"export PATH=/opt/cputil-linux-x64:$PATH",
"echo $PATH",
"ls /opt/cputil-linux-x64"
]

[environment]
PATH = "/opt/cputil-linux-x64:$PATH"

[phases.build]
cmds = [
"cputil help"
]
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
Hey @Brody I'm running into the same problem as earlier where yarn build command doesn't work "#15 1.262 Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation) #15 1.262 #15 1.262 $ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ... #15 ERROR: process "/bin/sh -c yarn run build" did not complete successfully: exit code: 1 -----"
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
Hey @Brody the solution worked but it didn't work for my case. I need to install a binary util called "cputil" and it can't be install with apt-get. I'm trying to do with a DockerFile again which looks like this
# Example using Node.js 18
FROM node:18

# Install system dependencies
RUN apt-get update && apt-get install -y \
libicu-dev \
libssl-dev \

# Copy cputil binary into the image
COPY /tools/cputil-linux-x64/cputil /usr/local/bin/cputil

# Make sure cputil is executable
RUN chmod +x /usr/local/bin/cputil

# Set the working directory
WORKDIR /app

# Copy the current directory contents into the container at /usr/src/app
COPY package.json .
COPY yarn.lock .

# Install any needed packages specified in package.json
RUN yarn run install

# Copy applicaiton code
COPY . .

RUN yarn run build

# Make port available to the world outside this container
EXPOSE 3000

# Run the app when the container launches
CMD ["node", "dist/src/server.js"]
# Example using Node.js 18
FROM node:18

# Install system dependencies
RUN apt-get update && apt-get install -y \
libicu-dev \
libssl-dev \

# Copy cputil binary into the image
COPY /tools/cputil-linux-x64/cputil /usr/local/bin/cputil

# Make sure cputil is executable
RUN chmod +x /usr/local/bin/cputil

# Set the working directory
WORKDIR /app

# Copy the current directory contents into the container at /usr/src/app
COPY package.json .
COPY yarn.lock .

# Install any needed packages specified in package.json
RUN yarn run install

# Copy applicaiton code
COPY . .

RUN yarn run build

# Make port available to the world outside this container
EXPOSE 3000

# Run the app when the container launches
CMD ["node", "dist/src/server.js"]
Now when i push to my github, railway starts building but it's not recognizing my DockerFile
[Region: us-west1]

==============

Using Nixpacks

==============


context: 8b1bbaf98b522d31c54bfc4d4cad323e



╔════════════════════ Nixpacks v1.20.0 ═══════════════════╗

║ setup │ nodejs_18, yarn-1_x, openssl ║

║─────────────────────────────────────────────────────────║

║ install │ npm install -g corepack && corepack enable ║

║ │ yarn install --check-cache ║

║─────────────────────────────────────────────────────────║

║ build │ yarn run build ║

║─────────────────────────────────────────────────────────║

║ start │ yarn run start ║

╚═════════════════════════════════════════════════════════╝
[Region: us-west1]

==============

Using Nixpacks

==============


context: 8b1bbaf98b522d31c54bfc4d4cad323e



╔════════════════════ Nixpacks v1.20.0 ═══════════════════╗

║ setup │ nodejs_18, yarn-1_x, openssl ║

║─────────────────────────────────────────────────────────║

║ install │ npm install -g corepack && corepack enable ║

║ │ yarn install --check-cache ║

║─────────────────────────────────────────────────────────║

║ build │ yarn run build ║

║─────────────────────────────────────────────────────────║

║ start │ yarn run start ║

╚═════════════════════════════════════════════════════════╝
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
I really appreciate the help @Brody
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
thank you, I'll try that and I'll let you know
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
I created a nixpacks.toml >
aptPkgs = ['libicu-dev']
aptPkgs = ['libicu-dev']
Would this do it?
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
if there's a way to install the ICU library without using the DockerFile please let me know
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
I had this project deployed to railway before without the DockerFile and everything worked perfectly, I'm only using the DockerFile because I need to install the ICU library
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
yes
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
No description
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
#11 [7/8] RUN yarn build



#11 1.582 Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)

#11 1.582

#11 1.582 $ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...



#11 ERROR: process "/bin/sh -c yarn build" did not complete successfully: exit code: 1

-----

> [7/8] RUN yarn build:

1.582 Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)

1.582

1.582 $ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...

-----



Dockerfile:17

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

15 | COPY . .

16 |

17 | >>> RUN yarn build

18 |

19 | # Install ICU library (example for a Debian-based image)

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

ERROR: failed to solve: process "/bin/sh -c yarn build" did not complete successfully: exit code: 1


#11 [7/8] RUN yarn build



#11 1.582 Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)

#11 1.582

#11 1.582 $ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...



#11 ERROR: process "/bin/sh -c yarn build" did not complete successfully: exit code: 1

-----

> [7/8] RUN yarn build:

1.582 Usage Error: Couldn't find the node_modules state file - running an install might help (findPackageLocation)

1.582

1.582 $ yarn run [--inspect] [--inspect-brk] [-T,--top-level] [-B,--binaries-only] <scriptName> ...

-----



Dockerfile:17

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

15 | COPY . .

16 |

17 | >>> RUN yarn build

18 |

19 | # Install ICU library (example for a Debian-based image)

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

ERROR: failed to solve: process "/bin/sh -c yarn build" did not complete successfully: exit code: 1


29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
yarn build would fail
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
the same error as the screenshot
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
Hey Bordy thanks for replying. This was my initial DockerFile
# Use an official Node.js runtime as a parent image
FROM node:18

# Set the working directory in the container
WORKDIR /app

# Copy the current directory contents into the container at /usr/src/app
COPY package.json .
COPY yarn.lock .

# Install any needed packages specified in package.json
RUN yarn install

# Copy applicaiton code
COPY . .

RUN yarn build

# Install ICU library (example for a Debian-based image)
RUN apt-get update && apt-get install -y libicu-dev

# Make port available to the world outside this container
EXPOSE 3000

# Run the app when the container launches
CMD ["node", "dist/src/server.js"]
# Use an official Node.js runtime as a parent image
FROM node:18

# Set the working directory in the container
WORKDIR /app

# Copy the current directory contents into the container at /usr/src/app
COPY package.json .
COPY yarn.lock .

# Install any needed packages specified in package.json
RUN yarn install

# Copy applicaiton code
COPY . .

RUN yarn build

# Install ICU library (example for a Debian-based image)
RUN apt-get update && apt-get install -y libicu-dev

# Make port available to the world outside this container
EXPOSE 3000

# Run the app when the container launches
CMD ["node", "dist/src/server.js"]
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
I need to install ICU library that's the only reason why I'm using DockerFile
29 replies
RRailway
Created by igli on 12/23/2023 in #✋|help
DockerFile fails to install packages with yarn install and doesn't generate node_modules
80aa096c-5a05-4e03-9772-a48238f8ffa9
29 replies