Strapi fails to deploy
When updating strapi and trying redeploying I am getting this error:
Dockerfile:20
-------------------
18 | ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH
19 | COPY . /app/.
20 | >>> RUN --mount=type=cache,id=s/e448085f-db1e-4536-a8cf-7398fdb05a1f-/root/npm,target=/root/.npm npm ci
21 |
22 | # build phase
-------------------
ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1
Error: Docker build failed
28 Replies
Project ID:
e448085f-db1e-4536-a8cf-7398fdb05a1f
can you run
npm ci
locally without issues?Yess
okay please provide full build logs
here's the full build log
npm ci
can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with npm install
before continuing.I have done that
delete the lock file and try again
result is the same
please provide a link to your repo
make it public please, a private repo is no use
Yess
it is public now
okay thanks, I will look into this when I have some time
Okay. Thank you! Would be great hearing from you
i was able to re-sync the lock file
How did you do it? NPM install?
Because I tried everything
i already tried that..
but I 'll try your ifles
Strange thing is, when I updated strapi to v4.12.0, I have the same problem again
So could there be something wrong with my npm?
maybe, I'm just using the npm version that came with node 18 lts
npm install --legacy-peer-deps=false package-lock.json
this fixed it 😉
Thanks for the help!
did my two files not work for you?
I had built your repo successfully after I re-synced the lock file
Yess, it did work. However, after that I tried updating to a newer version of Strapi (which came out a couple hours ago) and then I got the same error again.
what node and npm versions are you using?
i tried different versions. currently node 16 and npm 8.. however i also tried it with node 16 and npm 9, or node 18 with npm 9.. but it didn't make any difference
well that's very odd, I don't quite know what to tell you here
Hello, can you all help me? i think i have a similar problem..
==============
Using Nixpacks
==============
context: 04be27bdfb0ba154e8d71b8dc377adde
╔═════════ Nixpacks v1.12.0 ════════╗
║ setup │ nodejs-14_x, npm-9_x ║
║───────────────────────────────────║
║ install │ npm ci ║
║───────────────────────────────────║
║ start │ npm run start ║
╚═══════════════════════════════════╝
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.1s
#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 1.89kB done
#2 DONE 0.1s
#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:ubuntu-1690243402
#3 DONE 0.1s
#4 [stage-0 1/8] FROM ghcr.io/railwayapp/nixpacks:ubuntu-1690243402@sha256:1a7dc562bf1f13299c20e55f8a72a287cb16dfea072fe4d20d084cfe23494afd
#4 DONE 0.0s
#5 [internal] load build context
#5 transferring context: 1.91MB 0.0s done
#5 DONE 0.1s
#6 [stage-0 2/8] WORKDIR /app/
#6 CACHED
#7 [stage-0 3/8] COPY .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix
#7 CACHED
#8 [stage-0 4/8] RUN nix-env -if .nixpacks/nixpkgs-293a28df6d7ff3dec1e61e37cc4ee6e6c0fb0847.nix && nix-collect-garbage -d
#8 CACHED
#9 [stage-0 5/8] COPY . /app/.
#9 DONE 0.3s
#10 [stage-0 6/8] RUN --mount=type=cache,id=s/57fcf0bf-5432-49f0-aaec-332113155bb8-/root/npm,target=/root/.npm npm ci
#10 0.967 npm ERR! Cannot read property '@google-cloud/storage' of undefined
#10 0.975
#10 0.975 npm ERR! A complete log of this run can be found in:
#10 0.975 npm ERR! /root/.npm/_logs/2023-08-01T13_38_16_471Z-debug.log
#10 ERROR: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1
-----
[stage-0 6/8] RUN --mount=type=cache,id=s/57fcf0bf-5432-49f0-aaec-332113155bb8-/root/npm,target=/root/.npm npm ci:#10 0.967 npm ERR! Cannot read property '@google-cloud/storage' of undefined #10 0.975 #10 0.975 npm ERR! A complete log of this run can be found in: #10 0.975 npm ERR! /root/.npm/_logs/2023-08-01T13_38_16_471Z-debug.log ----- Dockerfile:20 ------------------- 18 | ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH 19 | COPY . /app/. 20 | >>> RUN --mount=type=cache,id=s/57fcf0bf-5432-49f0-aaec-332113155bb8-/root/npm,target=/root/.npm npm ci 21 | 22 | # build phase ------------------- ERROR: failed to solve: process "/bin/bash -ol pipefail -c npm ci" did not complete successfully: exit code: 1 Error: Docker build failed
please open your own help thread