Open lelelethu opened 6 months ago
if you are using lite version plz import from generate-password-lite.
import { GeneratePassword } from 'generate-password-lite'
I will install generate-password-lite and still has above errror.
Do you use which way to import?
import { GeneratePassword } from "generate-password-lite";
const { GeneratePassword } = "generate-password-lite";
Can confirm this error is encountered when using Node 20.11.1
SyntaxError: The requested module 'js-generate-password' does not provide an export named 'GeneratePassword'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:132:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:214:5)
at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
at async loadESM (node:internal/process/esm_loader:28:7)
at async handleMainPromise (node:internal/modules/run_main:113:12)
Node.js v20.11.1
I am having the same error while trying to import the module... Node.js v20.11.1
I writed as document, but why has error?
Error: export 'GeneratePassword' (imported as 'GeneratePassword') was not found in 'js-generate-password' (module has no exports)
My code:
import { GeneratePassword } from 'js-generate-password'
this.password = GeneratePassword({ length: this.lengthWord, numbers: this.isCheckedNumbers, uppercase: this.isCheckedUppercase, lowercase: this.isCheckedLowercase, symbols: this.isCheckedSymbols, exclude: '', minLengthLowercase: 1, minLengthUppercase: 1, minLengthNumbers: 1, minLengthSymbols: 0, })