Skip to content

Cannot find module '...' error when run under Yarn PnP #299

@djsavvy

Description

@djsavvy

I am using node v16.16.0.

When I try to yarn yarn node-dev server.js, I get the following error:

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\sraghuvanshi\src\EXPLOR\app\.yarn\cache\node-dev-npm-7.4.3-207a6050f3-7b7e77284f.zip\node_modules\node-dev\lib\loaders\load.mjs' imported from C:\Users\sraghuvanshi\src\EXPLOR\app\
Did you mean to import C:/Users/sraghuvanshi/src/EXPLOR/app/.yarn/cache/node-dev-npm-7.4.3-207a6050f3-7b7e77284f.zip/node_modules/node-dev/lib/loaders/load.mjs?

Note that the issue is simply one of back vs forward slashes. I see that resolve is the latest version in node-dev's package.json, so that's not the issue.

Also, adding the argument --require ./.pnp.cjs had no effect.

Any ideas for what might be going wrong here?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions