Build failing due to missing `.root/.cache/node/corepack/lastKnownGood.json`
My build is failing due to the missing file when installing yarn(?):
Solution:Jump to solution
Appears Nixpacks uses corepack internally and always uses the latest version
Workaround; create a
nixpacks.toml
file with this inside:
```toml
[phases.install]...58 Replies
Project ID:
33042bbf-0475-49c1-9110-2626993a4979
33042bbf-0475-49c1-9110-2626993a4979
tried refreshing the
yarn.lock
file (deleting it, deleting node_modules, and installing the project fresh, and push the new yarn.lock
file) - didn't resolve+1, same error for me right now
hello? 🥺
+1
+1 here, too!
Having this issue on all deployments
I deployed a rails instance just fine (it uses yarn), but react + vite is failing for me.
I can't manage to reproduce this error, mind sharing some more information about how you guys are deploying your apps?
Are all of you using yarn and are all of these NodeJS projects?
I have this issue on NextJs and NodeJs projects
and are you using yarn?
Yes
Will try and reproduce this with yarn real quick
Maybe this is relevant as well:
#11 2.224 npm
WARN EBADENGINE Unsupported engine {
#11 2.225 npm WARN EBADENGINE package: '[email protected]',
#11 2.225 npm WARN EBADENGINE required: { node: '^18.17.1 | >=20.10.0' },
#11 2.225 npm WARN EBADENGINE current: { node: 'v21.1.0', npm: '10.2.0' }
#11 2.225 npm WARN EBADENGINE }
I'm using the vite-react-template from Brody ( https://github.com/brody192/vite-react-template), deployed from a GitLab instance. It's using yarn v6. it was working 2 days ago. My only changes were jsx files.
I only updated an env
Maybe something in the image changed
Very strange, I can't manage to reproduce this, even when using the same template yrnsmth is using
What is also strange is my rails service is deploying fine, also using yarn v6.
On the react project I did a
git revert
to my changes, and redeployed, this was rejected also.Yeah it seems a cache file is missing in between the deployments then, maybe some of our cached data is gone and now it breaks? Is there a way to rebuild without any cache?
setting
NIXPACKS_NO_CACHE
to 1
is one way
another thing that could be worth trying is:
https://bookmarklets.up.railway.app/service-redeploy/How do I do that? Can I add to it ENV vars or do I need the railway.json?
in railway.json at the top level?
you can do it in your service variables
The ENV did not help for me
Could you try the bookmarklet?
just regular push/deploy - i have a turborepo monorepo setup, and building a vike (vite plugin ssr) app - yesterday it worked fine
The bookmarklet does not work either, it skipped due to no file changes because of the watch paths. I will try whitout watch paths
No luck
I also have turborepo btw
env var didn't do it for me - added it here, somehow feeling it's not the place:
that is the correct place, no worries
gotcha - so I set it to 1
still failing on
yarn install --frozen-lockfile
:
😬
And just to make sure, it was all working about a day ago, right?
aye
Yep - and the previous working deploy is still up and running fine
super strange
pushing without
yarn.lock
to see what'll happen 😄
same here - existing service runs
a warning i'm seeing - not sure if its related:
oh wait, that would definitally be related
it requires
20.10.0
but you're on 20.9.0
didn't work
any way I can configure that?
For me that is also a warning I see, but when I check the earlier succesfull build it was using the same node js version
in the package.json my
engines
is set to
You can set node version with NIXPACKS_NODE_VERSION
it should also pick it up from the node engine version set in your package.json
Not sure if anyone shared here but corepack has a bug https://github.com/nodejs/corepack/issues/379
GitHub
v0.25.0 crashes with ENOENT on fresh install · Issue #379 · nodejs/...
In a fresh docker container running Corepack crashes with ENOENT $ docker run --rm -it node:20.11.1 bash -c "npm install -g [email protected] && corepack yarn -v" Internal Error: EN...
bam!
The 0.25.0 was released ~2 hours ago, I'm checking whether there's a way to use
0.24.1
version instead
I made the fix in my CI pipeline by using npm install -g [email protected]
but not sure how to do it in Railway because it is using nixpacks 🤔Ah
That makes so much sense
yeah due to that update, can't release right now 😂
yea you just install that version
I already tried to force an version on that package, but no affects. it is handled by railway before installing the project
is it something that can be configured via
railway.json
?Solution
Appears Nixpacks uses corepack internally and always uses the latest version
Workaround; create a
nixpacks.toml
file with this inside:
yay! it's passed to the next stage! project installing 😄
worked! Thanks!!!
Thanks all!
🙏
Running into this issue, thank you all for debugging this already. Appreciate the open communication
deploys via
railway up
do not create a source, if that's how the deployment was done, you can redeploy via the deployments 3 dot menu or by doing railway up
again