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
Percy
Percy17mo ago
Project ID: e448085f-db1e-4536-a8cf-7398fdb05a1f
Brody
Brody17mo ago
can you run npm ci locally without issues?
stevenurk9494
stevenurk9494OP17mo ago
Yess
Brody
Brody17mo ago
okay please provide full build logs
stevenurk9494
stevenurk9494OP17mo ago
here's the full build log
Brody
Brody17mo ago
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.
stevenurk9494
stevenurk9494OP17mo ago
I have done that
Brody
Brody17mo ago
delete the lock file and try again
stevenurk9494
stevenurk9494OP17mo ago
result is the same
Brody
Brody17mo ago
please provide a link to your repo
Brody
Brody17mo ago
make it public please, a private repo is no use
stevenurk9494
stevenurk9494OP17mo ago
Yess it is public now
Brody
Brody17mo ago
okay thanks, I will look into this when I have some time
stevenurk9494
stevenurk9494OP17mo ago
Okay. Thank you! Would be great hearing from you
Brody
Brody17mo ago
i was able to re-sync the lock file
stevenurk9494
stevenurk9494OP17mo ago
How did you do it? NPM install? Because I tried everything
Brody
Brody17mo ago
npm i --package-lock-only
npm i --package-lock-only
stevenurk9494
stevenurk9494OP17mo ago
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?
Brody
Brody17mo ago
maybe, I'm just using the npm version that came with node 18 lts
stevenurk9494
stevenurk9494OP17mo ago
npm install --legacy-peer-deps=false package-lock.json this fixed it 😉 Thanks for the help!
Brody
Brody17mo ago
did my two files not work for you? I had built your repo successfully after I re-synced the lock file
stevenurk9494
stevenurk9494OP17mo ago
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.
Brody
Brody17mo ago
what node and npm versions are you using?
stevenurk9494
stevenurk9494OP17mo ago
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
Brody
Brody17mo ago
well that's very odd, I don't quite know what to tell you here
sixto
sixto16mo ago
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
Brody
Brody16mo ago
please open your own help thread
Want results from more Discord servers?
Add your server