每次我尝试在Heroku上部署May应用程序时,都会收到此代码错误:代码:'错误_DLOPEN_失败'

4ioopgfo  于 2022-11-04  发布在  Node.js
关注(0)|答案(3)|浏览(323)

I am new in Heroku and currently building an app with react (Node.js).
While I was able to push successfully my master branch to Heroku and Heroku confirms my app is deployed successfully, yet, the app is not deployed despite that is shows below deploy success message: "Deploy to Heroku".
Below is the error log in Heroku:

2022-02-08T00:45:18.702341+00:00 app[web.1]:     at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T00:45:18.702341+00:00 app[web.1]:     at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-02-08T00:45:18.702341+00:00 app[web.1]:   code: 'ERR_DLOPEN_FAILED'
2022-02-08T00:45:18.702342+00:00 app[web.1]: }
2022-02-08T00:45:18.924415+00:00 heroku[web.1]: Process exited with status 1
2022-02-08T00:45:19.739614+00:00 heroku[web.1]: State changed from starting to crashed
2022-02-08T00:45:31.255261+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=haksuly1movieapp.herokuapp.com request_id=05cc8ef9-baa5-4af8-8167-ab18ec9fc909 fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T00:45:31.413269+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=haksuly1movieapp.herokuapp.com request_id=83016251-e4f0-4bf0-87d0-39ecb39ddd3f fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T00:46:20.928808+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=haksuly1movieapp.herokuapp.com request_id=d243ef5c-56d8-4e22-b095-f3915e338c90 fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T00:46:21.142923+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=haksuly1movieapp.herokuapp.com request_id=49b1447a-2058-40c8-b85f-6934e1854ebb fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https

Below is the error log from CLI:

2022-02-08T00:45:12.986742+00:00 app[web.1]: ^
2022-02-08T00:45:12.986743+00:00 app[web.1]: 
2022-02-08T00:45:12.986744+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2022-02-08T00:45:12.986744+00:00 app[web.1]: at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
2022-02-08T00:45:12.986745+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T00:45:12.986745+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-02-08T00:45:12.986746+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-02-08T00:45:12.986746+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:102:18)
2022-02-08T00:45:12.986746+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2022-02-08T00:45:12.986746+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
2022-02-08T00:45:12.986747+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
2022-02-08T00:45:12.986747+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T00:45:12.986747+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-02-08T00:45:12.986748+00:00 app[web.1]: code: 'ERR_DLOPEN_FAILED'
2022-02-08T00:45:12.986748+00:00 app[web.1]: }
2022-02-08T00:45:13.178543+00:00 heroku[web.1]: Process exited with status 1
2022-02-08T00:45:13.264905+00:00 heroku[web.1]: State changed from starting to crashed
2022-02-08T00:45:13.273816+00:00 heroku[web.1]: State changed from crashed to starting
2022-02-08T00:45:15.956822+00:00 heroku[web.1]: Starting process with command `npm start`
2022-02-08T00:45:18.232060+00:00 app[web.1]: 
2022-02-08T00:45:18.232080+00:00 app[web.1]: > movie_api@1.0.0 start
2022-02-08T00:45:18.232081+00:00 app[web.1]: > node index.js
2022-02-08T00:45:18.232081+00:00 app[web.1]: 
2022-02-08T00:45:18.702302+00:00 app[web.1]: node:internal/modules/cjs/loader:1183
2022-02-08T00:45:18.702328+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2022-02-08T00:45:18.702329+00:00 app[web.1]: ^
2022-02-08T00:45:18.702330+00:00 app[web.1]: 
2022-02-08T00:45:18.702336+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2022-02-08T00:45:18.702337+00:00 app[web.1]: at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
2022-02-08T00:45:18.702338+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T00:45:18.702338+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-02-08T00:45:18.702338+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-02-08T00:45:18.702339+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:102:18)
2022-02-08T00:45:18.702340+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2022-02-08T00:45:18.702340+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
2022-02-08T00:45:18.702340+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
2022-02-08T00:45:18.702341+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T00:45:18.702341+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-02-08T00:45:18.702341+00:00 app[web.1]: code: 'ERR_DLOPEN_FAILED'
2022-02-08T00:45:18.702342+00:00 app[web.1]: }
2022-02-08T00:45:18.924415+00:00 heroku[web.1]: Process exited with status 1
2022-02-08T00:45:19.739614+00:00 heroku[web.1]: State changed from starting to crashed
2022-02-08T00:45:31.255261+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=haksuly1movieapp.herokuapp.com request_id=05cc8ef9-baa5-4af8-8167-ab18ec9fc909 fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T00:45:31.413269+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=haksuly1movieapp.herokuapp.com request_id=83016251-e4f0-4bf0-87d0-39ecb39ddd3f fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T00:46:20.928808+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=haksuly1movieapp.herokuapp.com request_id=d243ef5c-56d8-4e22-b095-f3915e338c90 fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T00:46:21.142923+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=haksuly1movieapp.herokuapp.com request_id=49b1447a-2058-40c8-b85f-6934e1854ebb fwd="88.130.53.4" dyno= connect= service= status=503 bytes= protocol=https
2022-02-08T01:06:56.000000+00:00 app[api]: Build started by user hakeemkayodesulyman@gmail.com
2022-02-08T01:07:18.099531+00:00 app[api]: Deploy 759fe937 by user hakeemkayodesulyman@gmail.com
2022-02-08T01:07:18.099531+00:00 app[api]: Release v17 created by user hakeemkayodesulyman@gmail.com
2022-02-08T01:07:18.394025+00:00 heroku[web.1]: State changed from crashed to starting
2022-02-08T01:07:21.000000+00:00 app[api]: Build succeeded
2022-02-08T01:07:21.034913+00:00 heroku[web.1]: Starting process with command `npm start`
2022-02-08T01:07:22.192406+00:00 app[web.1]: 
2022-02-08T01:07:22.192420+00:00 app[web.1]: > movie_api@1.0.0 start
2022-02-08T01:07:22.192420+00:00 app[web.1]: > node index.js
2022-02-08T01:07:22.192420+00:00 app[web.1]: 
2022-02-08T01:07:22.590438+00:00 app[web.1]: node:internal/modules/cjs/loader:1183
2022-02-08T01:07:22.590456+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2022-02-08T01:07:22.590456+00:00 app[web.1]: ^
2022-02-08T01:07:22.590457+00:00 app[web.1]: 
2022-02-08T01:07:22.590458+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2022-02-08T01:07:22.590458+00:00 app[web.1]: at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
2022-02-08T01:07:22.590459+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T01:07:22.590459+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-02-08T01:07:22.590459+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-02-08T01:07:22.590460+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:102:18)
2022-02-08T01:07:22.590460+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2022-02-08T01:07:22.590460+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
2022-02-08T01:07:22.590460+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
2022-02-08T01:07:22.590460+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T01:07:22.590461+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-02-08T01:07:22.590461+00:00 app[web.1]: code: 'ERR_DLOPEN_FAILED'
2022-02-08T01:07:22.590461+00:00 app[web.1]: }
2022-02-08T01:07:22.717250+00:00 heroku[web.1]: Process exited with status 1
2022-02-08T01:07:22.786581+00:00 heroku[web.1]: State changed from starting to crashed
2022-02-08T01:07:22.825527+00:00 heroku[web.1]: State changed from crashed to starting
2022-02-08T01:07:25.399388+00:00 heroku[web.1]: Starting process with command `npm start`
2022-02-08T01:07:26.987095+00:00 app[web.1]: 
2022-02-08T01:07:26.987107+00:00 app[web.1]: > movie_api@1.0.0 start
2022-02-08T01:07:26.987107+00:00 app[web.1]: > node index.js
2022-02-08T01:07:26.987108+00:00 app[web.1]: 
2022-02-08T01:07:27.610704+00:00 app[web.1]: node:internal/modules/cjs/loader:1183
2022-02-08T01:07:27.610728+00:00 app[web.1]: return process.dlopen(module, path.toNamespacedPath(filename));
2022-02-08T01:07:27.610729+00:00 app[web.1]: ^
2022-02-08T01:07:27.610730+00:00 app[web.1]: 
2022-02-08T01:07:27.610731+00:00 app[web.1]: Error: /app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
2022-02-08T01:07:27.610731+00:00 app[web.1]: at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
2022-02-08T01:07:27.610732+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T01:07:27.610733+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12)
2022-02-08T01:07:27.610733+00:00 app[web.1]: at Module.require (node:internal/modules/cjs/loader:1005:19)
2022-02-08T01:07:27.610733+00:00 app[web.1]: at require (node:internal/modules/cjs/helpers:102:18)
2022-02-08T01:07:27.610733+00:00 app[web.1]: at Object.<anonymous> (/app/node_modules/bcrypt/bcrypt.js:6:16)
2022-02-08T01:07:27.610734+00:00 app[web.1]: at Module._compile (node:internal/modules/cjs/loader:1101:14)
2022-02-08T01:07:27.610734+00:00 app[web.1]: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
2022-02-08T01:07:27.610734+00:00 app[web.1]: at Module.load (node:internal/modules/cjs/loader:981:32)
2022-02-08T01:07:27.610735+00:00 app[web.1]: at Function.Module._load (node:internal/modules/cjs/loader:822:12) {
2022-02-08T01:07:27.610735+00:00 app[web.1]: code: 'ERR_DLOPEN_FAILED'
2022-02-08T01:07:27.610735+00:00 app[web.1]: }
2022-02-08T01:07:27.789789+00:00 heroku[web.1]: Process exited with status 1
2022-02-08T01:07:27.876090+00:00 heroku[web.1]: State changed from starting to crashed

I have tried all tricks including many suggested here but it has not been helpful.
Of course, my package.json has this script. "start": "node index.js",
Could anyone help with a precise solution?

kcrjzv8t

kcrjzv8t1#

这个问题可能与Node_Modules中的缓存有关。我通过在终端中运行以下命令修复了这个问题:

$ git rm -r --cached .
$ git add .
$ git commit -m "fixed untracked files"
xyhw6mcr

xyhw6mcr2#

npm uninstall bcrypt
npm install bcryptjs
npm install bcrypt

All Good! nodejs v16.16.0
6psbrbz9

6psbrbz93#

使用bcryptjs而不是bcrypt

$ npm uninstall bcrypt
$ npm install bcryptjs

相关问题