brendanashworth / generate-password

NodeJS library for generating cryptographically-secure passwords.
MIT License
354 stars 67 forks source link

The package is missing the required crypto dependency. #25

Closed kahanu closed 4 years ago

kahanu commented 6 years ago

Can you update the NPM package to include the required dependencies, such as crypto?

brendanashworth commented 6 years ago

@kahanu I'm not sure what you mean, as crypto is a built-in module, and the package doesn't use any other downloadable ones. Is this for the browser?

kahanu commented 6 years ago

I got this error in Angular 4.x. Maybe your NPM package isn't built for Angular. If that's the case, then disregard this issue.

oliver-la commented 6 years ago

@brendanashworth I hope you don't mind me answering this issue.

@kahanu There was a PR once, but me and brendan decided on not merging it. Instead, there's a fork of this project which provides support for Angular. It's based on the same code. You can find it here: https://github.com/xama5/generate-password-browser

kahanu commented 6 years ago

@xama5 Thanks for the info. I'll go checkout the other repo.

josiahking commented 5 years ago

Am getting error, could not find main module: Error: Cannot find module crypto at generate.js:1:76

brendanashworth commented 5 years ago

@josiahking could you open a new issue?

fender commented 5 years ago

Don't assume crypto is on the browser. That's a node module and its quite common to remove it using build steps.

brendanashworth commented 4 years ago

I'm going to go ahead and close this issue as there isn't much to do here besides using the browser fork.

ducho commented 3 years ago

I try to use this package with webpack-encore but always module build failed to compile with errors.

Module build failed: Module not found:
"./node_modules/generate-password/src/generate.js" contains a reference to the file "crypto".
This file can not be found, please check it for typos or update it if the file got moved.

Can anybody help me?