getAlby / pkgzap

⚡️ View funding information of your dependencies and tip them via lightning

Home Page:https://pkgzap.albylabs.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Module import error when running with npx

hzrd149 opened this issue · comments

I'm using node 18 for most of my projects and when I run npx @getalby/pkgzap-cli I get the following module import error

$ npx @getalby/pkgzap-cli
node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/xxxxxx/.npm/_npx/3d08cac78fe9456f/node_modules/@scure/bip39/wordlists/english' imported from /home/xxxxxx/.npm/_npx/3d08cac78fe9456f/node_modules/nostr-tools/lib/esm/nostr.mjs
Did you mean to import @scure/bip39/wordlists/english.js?
    at new NodeError (node:internal/errors:405:5)
    at finalizeResolution (node:internal/modules/esm/resolve:324:11)
    at moduleResolve (node:internal/modules/esm/resolve:943:10)
    at defaultResolve (node:internal/modules/esm/resolve:1129:11)
    at nextResolve (node:internal/modules/esm/loader:163:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
    at link (node:internal/modules/esm/module_job:76:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v18.17.0

Reproduce

  • docker run --rm node:18 /bin/bash
  • npx @getalby/pkgzap-cli

I believe it could be related to nbd-wtf/nostr-tools#253

@hzrd149 I pushed a new release: https://www.npmjs.com/package/@getalby/pkgzap-cli
Can you see if it works now? Thanks!

Also, in order to test the new version you might have to do
npx @getalby/pkgzap-cli@latest

or if you wish to clear the cache (not recommended if you have other npx packages)
Do npx clear-npx-cache and then run npx @getalby/pkgzap-cli

Worked 👍
Now I have to go spread the word so I can have some packages to zap