Skip to content

[ERR_MODULE_NOT_FOUND] for path-to-regexp when using pnpm #2

@kevinfiol

Description

@kevinfiol

Description

I will likely look into this more, but I ran into this a few weeks ago when I was testing out Lancer, but have just kept forgetting to actually open up an issue. 😅 So now I finally did.

If it isn't clear, following these commands but using npm instead of pnpm works just fine.

System: Linux Mint 20.3 x86_64 (Ubuntu 20.04)
Node Version: 14.19.0
npm Version: 6.14.16
pnpm Version: 6.24.4

Steps to reproduce

mkdir lancer-test
cd lancer-test/
pnpm init -y
pnpm install @lancer/studio
pnpx lancer init all
pnpm run dev

Error

kevin@xps:~/me/dev/kevinfiol/lancer-test$ pnpm run dev

> lancer-test@1.0.0 dev /home/kevin/me/dev/kevinfiol/lancer-test
> lancer dev

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/home/kevin/me/dev/kevinfiol/lancer-test/node_modules/.pnpm/@lancer+studio@0.16.0/node_modules/express/node_modules/path-to-regexp/index.js' imported from /home/kevin/me/dev/kevinfiol/lancer-test/node_modules/.pnpm/@lancer+studio@0.16.0/node_modules/@lancer/studio/dist/server/index.js
    at new NodeError (node:internal/errors:371:5)
    at finalizeResolution (node:internal/modules/esm/resolve:416:11)
    at moduleResolve (node:internal/modules/esm/resolve:932:10)
    at defaultResolve (node:internal/modules/esm/resolve:1044:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:422:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:222:40)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:76:40)
    at link (node:internal/modules/esm/module_job:75:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}
 ELIFECYCLE  Command failed with exit code 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions