Cannot find package even installed
I'm deploying a Discord bot but I'm getting this returned error, the package is installed and working fine on local
Solution:Jump to solution
in your dockerfile, run a prune and then copy the node_modules folder into the final layer
43 Replies
Project ID:
N/A
is it installed in the dependencies or the dev dependencies
Dependencies
is your lock file in sync
Should be
My Dockerfile
try utilizing a lock file and install from the lock file
So I should try sending my yarn.lock together?
not sure what you mean by sending
Commiting together
your lock file should definitely be in your repo, and used to install the dependencies from
Let me try
are you sure railway is using your Dockerfile?
Yes
Not sure if it's using right
there's just some simple config issue somewhere with your project
Even with the yarn.lock file still the same error
please show me the updated dockerfile
Still the same
please see my message, this requires you to change the dockerfile a little bit
What else should I change?
install from the lock file
I don't know how to do that to be honest
Tried
RUN yarn install --frozen-lockfile
that is what you would want to be using in a production environment
And what should I use now?
exactly what you just sent
please update your dockerfile with this
Still giving the same error
locally, delete your node_modules and then run
yarn install --frozen-lockfile
and start your projectNow what?
No errors
what node version are you using locally
20.11.0
what version of node is
node:lts-alpine
I'm not sure, I think it's the last one available
its 20.13.1
So I might need to define the node version?
try using
node:20.11.0-alpine
Solution
in your dockerfile, run a prune and then copy the node_modules folder into the final layer
You mean
?
please take everything i said in this message into account
Working fine now @Brody
Thank you so much
no problem