Error: Cannot find module '@napi-rs/canvas-linux-x64-gnu'
Error: Cannot find module '@napi-rs/canvas-linux-x64-gnu'
Require stack:
- /app/node_modules/@napi-rs/canvas/js-binding.js
- /app/node_modules/@napi-rs/canvas/index.js
- /app/node_modules/greetify/build/structures/welcomeCard.js
- /app/node_modules/greetify/build/index.js
Solution:Jump to solution
In any case try removing package-lock.json and then run
npm i
so it will regenerate22 Replies
Project ID:
N/A
It often happens when a packages has binaries in it and your PC runs windows
Try removing
package-lock.json
and installing packages with npm i
and not npm ci
Other possibility is that you have this package installed globally on your system but it's not listed in dependencies in package.json
i got this while running on railway
Yeah, because railway's servers run linux
Are you deploying from github?
yes
should i remove package-lock.json from github
Solution
In any case try removing package-lock.json and then run
npm i
so it will regenerateI wouldn't say that's required, it's just that the current package lock is a bit broken
i got this
after doing this i got new error
That's not it 🙂
When a package requires binaries to run it will only download the ones that match your system, but it should also leave links to other versions for other systems
It seems like your current package lock has some problems with that
try regenerating it
ohk
let me regen
also you may remove node modules while doing that
issues like that often happen when deploying from templates (not railway templates specifically)
ohk ty
it worked
ty
i have a question
how i can use json databse on railway
yeah no problem
can u mark my response as a solution? 🙂
You mean a json file as a database or a document-database such as mongodb?
if we're talking about a json file, you can attach a volume and put that file on it, this way it will persist between deployments
just keep in mind that a single json file is not really scalable
i have a folder in which i store data as json file
then you need to mount a volume and store all the data on it
it mounts as a regular directory
wat
how
in linux you can mount a physical device as a folder and railway takes this advantage with volumes
just check in your app if it's on local machine or on railway and use a corresponding directory
in may be ./data on local and /data on railway
for now volumes don't have file explorer so there are two options
1. the app itself does initial upload (and backups when needed)
2. deploy a file explorer template first, upload all the files using it and then reattach the volume to the app
no need to commit that folder
if it contains any data it will be overridden by the volume
Anyway, if you have more question about volumes, please create a new post.
I want those sweet help points