ahmadjoya / generate-password-lite

generate-password-lite is usable for every javascript and typescript based project like react, vue, node, etc. it used to generate passwords that may contain alphabets, number and symbols. The options parameter enables the user to enable or disable the characters that are used to generate random password.
MIT License
36 stars 1 forks source link

Error: export 'GeneratePassword' (imported as 'GeneratePassword') was not found in 'js-generate-password' (module has no exports) #8

Open lelelethu opened 6 months ago

lelelethu commented 6 months ago

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, })

ahmadjoya commented 6 months ago

if you are using lite version plz import from generate-password-lite.

lelelethu commented 6 months ago

import { GeneratePassword } from 'generate-password-lite'

I will install generate-password-lite and still has above errror.

lelelethu commented 6 months ago

Do you use which way to import?

  1. import { GeneratePassword } from "generate-password-lite";

  2. const { GeneratePassword } = "generate-password-lite";

abetoots commented 6 months ago

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
ahmedfarhat99 commented 5 months ago

I am having the same error while trying to import the module... Node.js v20.11.1