Bcrypt: invalid ELF header with Docker and Sails.JS

后端 未结 7 1973
被撕碎了的回忆
被撕碎了的回忆 2021-01-02 02:41

My Node Dockfile:

# Set the base image to ubuntu
FROM ubuntu

# Define working directory
ADD . /src
WORKDIR /src

# Install Node.js & other          


        
7条回答
  •  轮回少年
    2021-01-02 02:58

    I was experiencing same thing, even though using Express, not Sails. I tried every suggestion here with no success. What made the trick was change the npm module bcrypt by bcryptjs:

    npm uninstal bcrypt
    npm install bcryptjs --save
    

    Then change your require to something like

    var bcrypt   = require('bcryptjs');
    

    It is working flawlessly now.

提交回复
热议问题