I have very limited coding skills. I’m Trying to build a program named Tabbycat in Docker. for that I installed docker and then I executed a file named windows_docker_start.bat given within the program in bin folder. Here a CMD window opens up and shows the following-
# transferring context: 158.13kB 0.5s
# CACHED [web 2/14] RUN apt-get update 0.0s
# CACHED [web 3/14] RUN apt-get install -y curl nginx 0.0s
# CACHED [web 4/14] RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - 0.0s
# CACHED [web 5/14] RUN apt-get install -y nodejs 0.0s
# CACHED [web 6/14] RUN mkdir /tcd 0.0s
# CACHED [web 7/14] WORKDIR /tcd 0.0s
# CACHED [web 8/14] ADD . /tcd/ 0.0s
# CACHED [web 9/14] RUN git config --global url."https://".insteadOf git:// 0.0s
# CACHED [web 10/14] RUN pip install pipenv 0.0s
# CACHED [web 11/14] RUN pipenv install --system --deploy 0.0s
# ERROR [web 12/14] RUN npm ci --only=production 0.4s
------
> [web 12/14] RUN npm ci --only=production:
0.381 /bin/sh: 1: npm: not found
------
failed to solve: process "/bin/sh -c npm ci --only=production" did not complete successfully: exit code: 127
how can I fix this error? There is a similar question in StackOveflow and someone adviced,
Try installing npm separately
But How do I do that? I’m running a .bat file, please someone help me
2
Answers
After seeing the build logs, it seems that you haven’t had npm on the build environment. There should be nothing to be done to the bat file and only the Dockerfile should be changed.
You should change
RUN apt-get install -y nodejs
toRUN apt-get install -y nodejs npm
Source: phoenixNAP
If something breaks, it’s always worth to take a look to chase that down.
You are trying to execute
windows_docker_start.bat
now, what is that actually doing? If you check out the file on GitHub you can see that this is actually just adocker-compose
command.If you didn’t change anything, you can find the compose file it’s trying to run on GitHub as well. As you can see, it’s instructed to run a postgresDB as well as build two images from the local directory. You can now try to run the build buy hand to reproduce:
or you can check the commit history and find that there’s been an issue with the
npm
installation in the past that has been fixed.Hence, if you upgrade to the latest version by pulling from GitHub your issue will go away. Note that the current latest release as of writing this comment, does not include this fix.