repomix icon indicating copy to clipboard operation
repomix copied to clipboard

npx repomix kabooms with "Cannot find module ... cliRun.js"

Open yarikoptic opened this issue 2 months ago • 5 comments

Might be a user error and RTFM (not a JS fella here) but tried to follow README.md stating:

You can try Repomix instantly in your project directory without installation:

npx repomix

and got (tried two ways) while running within the fresh clone at v0.2.5-10-g05589f7 :

❯ npx repomix
Fatal Error: {
  name: 'Error',
  message: "Cannot find module '/home/yoh/proj/misc/repomix/lib/cli/cliRun.js' imported from /home/yoh/proj/misc/repomix/bin/repomix.cjs",
  stack: "Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/yoh/proj/misc/repomix/lib/cli/cliRun.js' imported from /home/yoh/proj/misc/repomix/bin/repomix.cjs\n" +
    '    at finalizeResolution (node:internal/modules/esm/resolve:265:11)\n' +
    '    at moduleResolve (node:internal/modules/esm/resolve:933:10)\n' +
    '    at defaultResolve (node:internal/modules/esm/resolve:1169:11)\n' +
    '    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)\n' +
    '    at ModuleLoader.resolve (node:internal/modules/esm/loader:510:25)\n' +
    '    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)\n' +
    '    at ModuleLoader.import (node:internal/modules/esm/loader:472:34)\n' +
    '    at defaultImportModuleDynamicallyForScript (node:internal/modules/esm/utils:227:31)\n' +
    '    at importModuleDynamicallyCallback (node:internal/modules/esm/utils:249:12)\n' +
    '    at /home/yoh/proj/misc/repomix/bin/repomix.cjs:42:21'
}

❯ find -iname cliRun.js

❯ find -iname cliRun.*
./src/cli/cliRun.ts
./tests/cli/cliRun.test.ts

❯ npx .
Fatal Error: {
  name: 'Error',
  message: "Cannot find module '/home/yoh/.npm/_npx/bc821935aa97a4d0/node_modules/repomix/lib/cli/cliRun.js' imported from /home/yoh/.npm/_npx/bc821935aa97a4d0/node_modules/repomix/bin/repomix.cjs",
  stack: "Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/yoh/.npm/_npx/bc821935aa97a4d0/node_modules/repomix/lib/cli/cliRun.js' imported from /home/yoh/.npm/_npx/bc821935aa97a4d0/node_modules/repomix/bin/repomix.cjs\n" +
    '    at finalizeResolution (node:internal/modules/esm/resolve:265:11)\n' +
    '    at moduleResolve (node:internal/modules/esm/resolve:933:10)\n' +
    '    at defaultResolve (node:internal/modules/esm/resolve:1169:11)\n' +
    '    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)\n' +
    '    at ModuleLoader.resolve (node:internal/modules/esm/loader:510:25)\n' +
    '    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:239:38)\n' +
    '    at ModuleLoader.import (node:internal/modules/esm/loader:472:34)\n' +
    '    at defaultImportModuleDynamicallyForScript (node:internal/modules/esm/utils:227:31)\n' +
    '    at importModuleDynamicallyCallback (node:internal/modules/esm/utils:249:12)\n' +
    '    at /home/yoh/.npm/_npx/bc821935aa97a4d0/node_modules/repomix/bin/repomix.cjs:42:21'
}

versions info

❯ npx --version
9.2.0

❯ which npx
/usr/bin/npx

❯ dlocate /usr/bin/npx
npm: /usr/bin/npx

❯ apt-cache policy  npm
npm:
  Installed: 9.2.0~ds1-3
  Candidate: 9.2.0~ds1-3
  Version table:
 *** 9.2.0~ds1-3 900
        600 https://deb.debian.org/debian sid/main amd64 Packages
        600 https://deb.debian.org/debian sid/main i386 Packages
        900 https://deb.debian.org/debian trixie/main amd64 Packages
        900 https://deb.debian.org/debian trixie/main i386 Packages
        100 /var/lib/dpkg/status
     9.2.0~ds1-1 100
        100 https://deb.debian.org/debian bookworm/main amd64 Packages
        100 https://deb.debian.org/debian bookworm/main i386 Packages

yarikoptic avatar Dec 09 '24 13:12 yarikoptic