Search code examples
node.jsbackendrender

While Deploying Nodejs backend on render getting this error


(https://i.sstatic.net/J63mLZ2C.png)


Error: /opt/render/project/src/server/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
at Module._extensions..node (node:internal/modules/cjs/loader:1465:18)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Module._load (node:internal/modules/cjs/loader:1022:12)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (/opt/render/project/src/server/node_modules/bcrypt/bcrypt.js:6:16)
at Module._compile (node:internal/modules/cjs/loader:1369:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Module._load (node:internal/modules/cjs/loader:1022:12) {
code: 'ERR_DLOPEN_FAILED'
}

What suppose to be the error ??

I tried to add the updated node version and also latest version of the bcrypt. But nothing works.


Solution

  • This happens when you upload the ndoe_modules folder which was created on a different operating system. Ensure to not add it in your github repo and add it to gitignore file. Here is a page with a similar issue. render deployment failed