Argon2 with node docker container
Answering for posterity sake:
Sounds like you have no .dockerignore
file so when you COPY . .
you are pulling over the node_modules
folder from your local machine (Windows) and trying to run it in Docker (Alpine Linux), so while you correctly run npm install argon2
in the Docker context, you overwrite it when you copy from local to Docker. If you create a .dockerignore
file, add /node_modules
to it so that you don;t move the node_modules
directory
I also had this issue I did the above tip by Jay McDoniel. Although for me I also had another problem that seemed to have thrown the same error. The problem for me was I accidentally npm install
ed something in my project while using a yarn project where I should have yarn add
ed this gave a warning that said:
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this. warning, remove package-lock.json.
The problem wasn't yet fixed until I removed package-lock.json
(lesson learned: pick your least favorite of the two lockfiles (yarn.lock
or package-lock.json
) to remove from you project and always keep just one type of package manager in use between yarn
and npm
)