How can I deploy my projects from the Quality Assurance course on Vercel

I’m using Replit, but I’d like to keep my projects working 24 hours a day and for that I’m trying to use Vercel.

However, I’m not able to deploy it, I think it’s due to using Express servers.

I already created a vercel.json file but I didn’t get any results.
Here is my project: github.com/adrianwilker/metric-imperial-converter

I’m getting this log in Vercel:

Error: ENOENT: no such file or directory, scandir './tests'
    at Object.readdirSync (node:fs:1527:3)
    at Object.<anonymous> (/var/task/test-runner.js:40:4)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at r.<computed>.e._load (/var/task/___vc/__launcher/bridge-server-72TT5FOD.js:1:1574)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/var/task/routes/fcctesting.js:32:16) {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: './tests'
}
INIT_REPORT Init Duration: 301.02 ms	Phase: init	Status: error	Error Type: Runtime.ExitError
Error: ENOENT: no such file or directory, scandir './tests'
    at Object.readdirSync (node:fs:1527:3)
    at Object.<anonymous> (/var/task/test-runner.js:40:4)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at r.<computed>.e._load (/var/task/___vc/__launcher/bridge-server-72TT5FOD.js:1:1574)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (/var/task/routes/fcctesting.js:32:16) {
  errno: -2,
  syscall: 'scandir',
  code: 'ENOENT',
  path: './tests'
}
INIT_REPORT Init Duration: 507.61 ms	Phase: invoke	Status: error	Error Type: Runtime.ExitError
Error: Runtime exited with error: exit status 1
Runtime.ExitError

image

Vercel isn’t the ideal choice for pure Node backend server code.

You can try searching for “free node js hosting” there are a few options (like Render). But as far as it “always being online”, all the free options I know of have some limitations and the instances will spin down after some time of being idle. They all spin back up again as needed but they won’t just sit active. If you want that, you have to pay for it.

1 Like