Error: Command failed: yarn run postinstall when deploying
everything goes just fine up until step: [4/5] Linking dependencies...
then warnings due to "incorrect peer dependency" and then on step: [5/5] Building fresh packages... the error:
#10 46.48 ],
#10 46.48 Buffer(39) [Uint8Array] [
#10 46.48 101, 114, 114, 111, 114, 32, 67, 111,
...
#10 46.48 111, 100, 101, 32, 49, 46, 10
#10 46.48 ]
#10 46.48 ],
#10 46.48 pid: 626,
#10 46.48 stdout: Buffer(1019) [Uint8Array] [
#10 46.48 121, 97, 114, 110, 32, 114, 117, 110, 32, 118, 49, 46,
...
#10 46.48 112, 112, 108, 121,
#10 46.48 ... 919 more items
#10 46.48 ],
#10 46.48 stderr: Buffer(39) [Uint8Array] [
#10 46.48 101, 114, 114, 111, 114, 32, 67, 111,
...
#10 46.48 111, 100, 101, 32, 49, 46, 10
#10 46.48 ]
#10 46.48 }
#10 46.48
#10 46.48 Node.js v18.18.2
#10 46.48 info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
#10 ERROR: process "/bin/bash -ol pipefail -c yarn install --frozen-lockfile" did not complete successfully: exit code: 1
[ 6/10] RUN yarn install --frozen-lockfile:46.48 101, 114, 114, 111, 114, 32, 67, 111, ... 46.48 111, 100, 101, 32, 49, 46, 10 46.48 ] 46.48 } 46.48 46.48 Node.js v18.18.2 Dockerfile:20 18 | ENV NIXPACKS_PATH /app/node_modules/.bin:$NIXPACKS_PATH 19 | COPY . /app/. 20 | >>> RUN yarn install --frozen-lockfile 22 | # build phase ERROR: failed to solve: process "/bin/bash -ol pipefail -c yarn install --frozen-lockfile" did not complete successfully: exit code: 1 Error: Docker build failed
75 Replies
Project ID:
a70260db-7017-4d36-a05a-586d821d913a
Project ID:
a70260db-7017-4d36-a05a-586d821d913a
project ID: a70260db-7017-4d36-a05a-586d821d913a
build logs please https://bookmarklets.up.railway.app/log-downloader/
do you have a postinstall script?
no
yes you do
do you mean on railway?
I don't know! 🥺
in your package.json
installed because it was an error in a previous deploy
what does
patch-package
doit let me change some files on the admin panel without breaking things and being able to update withut problems
basically grid cols ans stuff like that to change the appearance
can you delete your local node_modules folder and then run
yarn install --frozen-lockfile
- let me know if that is successfulI use locally npm, but it has not been a problem until now
do you have a yarn lock file?
yes
in case you need it or want to check it
if you dont use yarn, then you can delete it
done
do you have a package lock file?
yes
what version of node do you use locally?
21 installed
21.1.0
then in your package.json set
engines.node
to 21
that exact version or just 21?
sorry
just
21
done, npm install?
run
npm ci
running
done
show me the package.json now please
{
"name": "corporate-blog-template",
"private": true,
"version": "0.1.0",
"description": "A Strapi application",
"scripts": {
"dev": "strapi develop",
"start": "strapi start",
"build": "strapi build",
"strapi": "strapi",
"postinstall": "patch-package"
},
"dependencies": {
"@babel/core": "^7.23.7",
"@babel/runtime": "^7.23.8",
"@ckeditor/ckeditor5-core": "^41.0.0",
"@ckeditor/ckeditor5-engine": "^41.0.0",
"@ckeditor/ckeditor5-utils": "^41.0.0",
"@ckeditor/ckeditor5-watchdog": "^41.0.0",
"@ckeditor/strapi-plugin-ckeditor": "^0.0.10",
"@codemirror/autocomplete": "^6.12.0",
"@codemirror/language": "^6.10.0",
"@codemirror/lint": "^6.4.2",
"@codemirror/search": "^6.5.5",
"@codemirror/state": "^6.4.0",
"@codemirror/theme-one-dark": "^6.1.2",
"@codemirror/view": "^6.23.0",
"@lezer/common": "^1.2.1",
"@strapi/data-transfer": "^4.15.1",
"@strapi/plugin-i18n": "4.15.5",
"@strapi/plugin-seo": "^1.8.0",
"@strapi/plugin-users-permissions": "4.15.5",
"@strapi/provider-upload-cloudinary": "^4.14.5",
"@strapi/strapi": "4.15.5",
"better-sqlite3": "8.4.0",
"codemirror": "^6.0.1",
"eslint": "^8.56.0",
"patch-package": "^8.0.0",
"pg": "^8.11.3",
"postinstall-postinstall": "^2.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^5.3.4",
"strapi-plugin-import-export-entries": "^1.21.1",
"styled-components": "^5.3.11"
},
"author": {
"name": "A Strapi developer"
},
"strapi": {
"uuid": "42b937aa-0f16-4a30-bb55-95f60ec03b48"
},
"engines": {
"node": "21",
"npm": ">=6.0.0"
},
"license": "MIT"
}
looks good, in the future just send the file tho
yes sorry
push your changes to github
pushed, deploying on railway...
I have to downgrade the node version
to 20, right?
you told me you use node 21 locally?
yes
but the deploy shows an error:
error @strapi/[email protected]: The engine "node" is incompatible with this module. Expected version ">=18.0.0 <=20.x.x". Got "21.1.0"
alright then set it to 20
running deploy...
same error even in my package.json engines.node: 20
1.714 [3/5] Fetching packages...
33.24 error @strapi/[email protected]: The engine "node" is incompatible with this module. Expected version ">=18.0.0 <=20.x.x". Got "21.1.0"
33.25 error Found incompatible module.
build logs please
its still using node 21
but I changed my package.json and set it to 20
show me?
sorry i did pushed other file, pushing now the right one... really sorry
deploying now...
31.42 error @strapi/[email protected]: The engine "node" is incompatible with this module. Expected version ">=12.x.x <=18.x.x". Got "20.9.0"
31.44 error Found incompatible module.
should I try that exact version?
try
18
deploying...
do you have a yarn lock file
no
railway seems to think otherwise
maybe from previous deploys?
i did not push the remove yarn.lock file from before, when you told me, pushing it now...
deploying again...
different errors now
run
node --version
locallyv21.1.0
im not sure how you are able to install stuff locally that is requiring node 18
just to be on the same version I could use nvm to install v18 of node
done, installed v18 and using it now locally
>node --version
v18.19.0
delete node_modules
run
npm ci
run npm build
all successful?doing it...
no problem at all
running strapi develop and the server just started with no problems
has this ever worked on railway?
yes
when
until today
last deploy was few weeks ago
wait
deploying again
it seems to work... still deploying
i did a push after this
=== Successfully Built! ===
Oh my god!
woohoo
yeah!!!!!!
it worked, running now
I am very grateful for your help!!!!
I don't knw if I can do something to give you points or something like that
haha you don't need to give me anything
but I greatly appreciate the thought
thank you very much man!!
or woman, sorry
man, but no problem!
thanks a lot!