Deploying a Fullstack ReactJS Express Application

Hello everyone.

My fullstack application that I have written with ReactJS and Express is working fine on my local machine.

However, when I attempt to deploy it with Render, I am greeted with the following error:

Error: The module '/opt/render/project/src/node-rest-api/node_modules/better-sqlite3/build/Release/better_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 115. This version of Node.js requires
NODE_MODULE_VERSION 127. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

My understanding is this is caused because the node version used to compile the installed better_sqlite3 is not the same as the node version currently used to run the Express server?

So far, I have tried the following inside the node-rest-api directory:

npm i -D electron-rebuild

Deleting the node_modules directory and the package-lock.json file.

Adding the subsequent line to my package.json under “scripts”:
“rebuild”: “electron-rebuild -f -w better-sqlit3”

npm i
npm rebuild

Any suggestions on how I can remedy this roadblock?

You should not be including node_modules/ in your repository. The deployment process running npm install handles that step and chooses appropriate versions for the (1) OS/architecture, and (2) version of Node in use on the target system.

Hello. I was able to run a successful build and make my service live.

Yes, removing the node_modules directories from the node-rest-api backend project.

Thank you for your help.