My node app refuse to deploy after update to code

I am currently trying to deploy my app, and it’s failing. The last deployment was successful, but the latest deployment is failing. Could it be because of some updates I made to the codebase?

Here is the log I got:
Error: /opt/render/project/src/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
Aug 12 11:02:24 AM at Object.Module._extensions…node (internal/modules/cjs/loader.js:1127:18)
Aug 12 11:02:24 AM at Module.load (internal/modules/cjs/loader.js:933:32)
Aug 12 11:02:24 AM at Function.Module._load (internal/modules/cjs/loader.js:774:14)
Aug 12 11:02:24 AM at Module.require (internal/modules/cjs/loader.js:957:19)
Aug 12 11:02:24 AM at require (internal/modules/cjs/helpers.js:88:18)
Aug 12 11:02:24 AM at Object. (/opt/render/project/src/node_modules/bcrypt/bcrypt.js:6:16)
Aug 12 11:02:24 AM at Module._compile (internal/modules/cjs/loader.js:1068:30)
Aug 12 11:02:24 AM at Object.Module._extensions…js (internal/modules/cjs/loader.js:1097:10)
Aug 12 11:02:24 AM at Module.load (internal/modules/cjs/loader.js:933:32)
Aug 12 11:02:24 AM at Function.Module._load (internal/modules/cjs/loader.js:774:14)

Invalid ELF header means that the file has a different architecture than the system running it. It could be a Windows binary, or perhaps an ARM binary because of MacOS or Raspberry Pis and other micro PCs, etc.

The most common cause of this problem is that you included that file as part of your git repository. You shouldn’t include node_modules in your repository, the npm install process picks up dependencies relevant to the architecture it’s running on.

Alternatively, the package author may have screwed up their packaging and included/referenced the bad file. Uncommon, but happens.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.