![](/img/trans.png)
[英]ERROR: /ng-app/node_modules/bcrypt/lib/binding/bcrypt_lib.node: invalid ELF header
[英]Invalid ELF header with node bcrypt on AWSBox
我正在玩awsbox,部署我的應用程序會顯示以下錯誤:
/home/app/code/node_modules/mongoose-troop/node_modules/bcrypt/node_modules/bindings/bindings.js:79
throw e
^
Error: /home/app/code/node_modules/mongoose-troop/node_modules/bcrypt/build/Release/bcrypt_lib.node: invalid ELF header
at Object.Module._extensions..node (module.js:485:11)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:362:17)
at require (module.js:378:17)
at bindings (/home/app/code/node_modules/mongoose-troop/node_modules/bcrypt/node_modules/bindings/bindings.js:74:15)
at Object.<anonymous> (/home/app/code/node_modules/mongoose-troop/node_modules/bcrypt/bcrypt.js:1:97)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
warn: Forever detected script exited with code: 1
warn: Forever restarting script for 1 time
任何想法如何解決這個問題?
[出於其他原因,我也遇到了相同的錯誤(請參見注釋),以防萬一它對其他人有用:我通過使用以下命令通過npm重新安裝bcrypt模塊來解決了這個問題:
npm install bcrypt
不知道最好的答案是什么,但是我確實找到了一些帖子,提到了x86與64位問題。 我刪除了mongoose-troop模塊,並從awsbox控制台中調用了npm install,這似乎已經完成了。 雖然不確定如何部署到awsbox。 可能不起作用
請通過npm install重新安裝bcrypt模塊,然后重新啟動服務器。 應該解決。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.