Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using esrun with "import 'dotenv/config'; " is not working on windows #45

Open
stephane303 opened this issue Apr 29, 2024 · 2 comments
Open

Comments

@stephane303
Copy link

All I do is

import 'dotenv/config';
esrun index1.ts
node:internal/process/esm_loader:40
      internalBinding('errors').triggerUncaughtException(
                                ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\stef\solana1\node_modules\.bin\node_modules\dotenv\config.js' imported from C:\Users\stef\solana1\node_modules\.bin\esrun-1714418302774.tmp.mjs
Did you mean to import ../../dotenv/config.js?
    at __node_internal_captureLargerStackTrace (node:internal/errors:497:5)
    at new NodeError (node:internal/errors:406:5)
    at finalizeResolution (node:internal/modules/esm/resolve:233:11)
    at moduleResolve (node:internal/modules/esm/resolve:845:10)
    at defaultResolve (node:internal/modules/esm/resolve:1043:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:228:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
    at link (node:internal/modules/esm/module_job:84:36) {
  url: 'file:///C:/Users/stef/solana1/node_modules/.bin/node_modules/dotenv/config.js',
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v20.9.0

And the same file without esrun is working fine

@DarkTwistter
Copy link

+1

1 similar comment
@nileshp07
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants