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

loading module-alias when using esm #127

Open
TOTOChadi opened this issue Jul 28, 2022 · 0 comments
Open

loading module-alias when using esm #127

TOTOChadi opened this issue Jul 28, 2022 · 0 comments

Comments

@TOTOChadi
Copy link

So , module-alias works pretty well when using it in a dev enviroment when used like this in package.json :
node -r esm -r module-alias/register index.js .
but as soon as i want to generate a bin
eg :
"bin": { "express-cli": "./index.js" },
i get an error when trying to execute the command specifying that it can't find my packages :

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'classes' imported from /home/chadist/Desktop/express-gen/index.js at new NodeError (node:internal/errors:371:5) at packageResolve (node:internal/modules/esm/resolve:845:9) at moduleResolve (node:internal/modules/esm/resolve:890:18) at Loader.defaultResolve [as _resolve] (node:internal/modules/esm/resolve:1004:11) at Loader.resolve (node:internal/modules/esm/loader:89:40) at Loader.getModuleJob (node:internal/modules/esm/loader:242:28) 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' }

any idea how can i load the script when executing the command?

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

1 participant