Search code examples
angularbuildnode-modulesmonorepoargon2-ffi

Angular build fails after adding argon2 or bcrypt from npm


I have an Angular project where I want to use argon2 library to encrypt passwords. I added it to the back end, the implementation it's fine but my Angular front end app started to break.

I get a huge list of errors like:

ERROR in /<project>/node_modules/argon2/node_modules/minizlib/constants.js
Module not found: Error: Can't resolve 'zlib' in '/<project>/node_modules/argon2/node_modules/minizlib'

This is just one of the errors, I have similar errors for modules like crypto, fs, http, https, os, path, stream and many others. Same happens if I use bcrypt.

Do you know what is issue?


Solution

  • Angular doesn’t support working with node js modules Like fs and more. U could find a package for encrypting password from npm to do the work instead.