R
Railway•10mo ago
nestor8064

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
Yarn
Yarn
Fast, reliable, and secure dependency management.
75 Replies
Percy
Percy•10mo ago
Project ID: a70260db-7017-4d36-a05a-586d821d913a
Percy
Percy•10mo ago
Project ID: a70260db-7017-4d36-a05a-586d821d913a
nestor8064
nestor8064•10mo ago
project ID: a70260db-7017-4d36-a05a-586d821d913a
Brody
Brody•10mo ago
do you have a postinstall script?
nestor8064
nestor8064•10mo ago
nestor8064
nestor8064•10mo ago
no
Brody
Brody•10mo ago
yes you do
nestor8064
nestor8064•10mo ago
do you mean on railway? I don't know! 🥺
Brody
Brody•10mo ago
in your package.json
nestor8064
nestor8064•10mo ago
installed because it was an error in a previous deploy
Brody
Brody•10mo ago
what does patch-package do
nestor8064
nestor8064•10mo ago
it 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
Brody
Brody•10mo ago
can you delete your local node_modules folder and then run yarn install --frozen-lockfile - let me know if that is successful
nestor8064
nestor8064•10mo ago
I use locally npm, but it has not been a problem until now
Brody
Brody•10mo ago
do you have a yarn lock file?
nestor8064
nestor8064•10mo ago
yes
nestor8064
nestor8064•10mo ago
nestor8064
nestor8064•10mo ago
in case you need it or want to check it
Brody
Brody•10mo ago
if you dont use yarn, then you can delete it
nestor8064
nestor8064•10mo ago
done
Brody
Brody•10mo ago
do you have a package lock file?
nestor8064
nestor8064•10mo ago
yes
Brody
Brody•10mo ago
what version of node do you use locally?
nestor8064
nestor8064•10mo ago
21 installed 21.1.0
Brody
Brody•10mo ago
then in your package.json set engines.node to 21
nestor8064
nestor8064•10mo ago
that exact version or just 21? sorry
Brody
Brody•10mo ago
just 21
nestor8064
nestor8064•10mo ago
done, npm install?
Brody
Brody•10mo ago
run npm ci
nestor8064
nestor8064•10mo ago
running done
Brody
Brody•10mo ago
show me the package.json now please
nestor8064
nestor8064•10mo ago
{ "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" }
Brody
Brody•10mo ago
looks good, in the future just send the file tho
nestor8064
nestor8064•10mo ago
yes sorry
Brody
Brody•10mo ago
push your changes to github
nestor8064
nestor8064•10mo ago
pushed, deploying on railway...
nestor8064
nestor8064•10mo ago
I have to downgrade the node version to 20, right?
Brody
Brody•10mo ago
you told me you use node 21 locally?
nestor8064
nestor8064•10mo ago
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"
Brody
Brody•10mo ago
alright then set it to 20
nestor8064
nestor8064•10mo ago
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.
Brody
Brody•10mo ago
build logs please
Brody
Brody•10mo ago
its still using node 21
nestor8064
nestor8064•10mo ago
but I changed my package.json and set it to 20
Brody
Brody•10mo ago
show me?
nestor8064
nestor8064•10mo ago
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?
Brody
Brody•10mo ago
try 18
nestor8064
nestor8064•10mo ago
deploying...
Brody
Brody•10mo ago
do you have a yarn lock file
nestor8064
nestor8064•10mo ago
no
Brody
Brody•10mo ago
railway seems to think otherwise
nestor8064
nestor8064•10mo ago
maybe from previous deploys? i did not push the remove yarn.lock file from before, when you told me, pushing it now... deploying again...
nestor8064
nestor8064•10mo ago
different errors now
Brody
Brody•10mo ago
run node --version locally
nestor8064
nestor8064•10mo ago
v21.1.0
Brody
Brody•10mo ago
im not sure how you are able to install stuff locally that is requiring node 18
nestor8064
nestor8064•10mo ago
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
Brody
Brody•10mo ago
delete node_modules run npm ci run npm build all successful?
nestor8064
nestor8064•10mo ago
doing it... no problem at all running strapi develop and the server just started with no problems
Brody
Brody•10mo ago
has this ever worked on railway?
nestor8064
nestor8064•10mo ago
yes
Brody
Brody•10mo ago
when
nestor8064
nestor8064•10mo ago
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!
Brody
Brody•10mo ago
woohoo
nestor8064
nestor8064•10mo ago
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
Brody
Brody•10mo ago
haha you don't need to give me anything but I greatly appreciate the thought
nestor8064
nestor8064•10mo ago
thank you very much man!! or woman, sorry
Brody
Brody•10mo ago
man, but no problem!
nestor8064
nestor8064•10mo ago
thanks a lot!
Want results from more Discord servers?
Add your server