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

Doesn't work on node v18.12.1? #133

Open
qxb3 opened this issue Dec 6, 2022 · 4 comments
Open

Doesn't work on node v18.12.1? #133

qxb3 opened this issue Dec 6, 2022 · 4 comments

Comments

@qxb3
Copy link

qxb3 commented Dec 6, 2022

index.js

require('module-alias/register')
...

package.json

{
  ...
  "_moduleAliases": {
    "#root": "./",
    "#src": "./src",
    "#routes": "./src/routes",
    "#lib": "./src/lib",
    "#utils": "./src/lib/utils",
    "#models": "./src/lib/models",
    "#decors": "./src/lib/decors",
    "#schemas": "./src/lib/schemas"
  }
  ...
}

versions

node: v18.21.1
module-alias: 2.2.2

@yunylz
Copy link

yunylz commented Dec 27, 2022

and the error??

@girixcode7
Copy link

@qxb3 How did you resolve this issue?
In case of mine It throws Can't Find module ?

node:internal/modules/cjs/loader:1042
  throw err;
  ^
Error: Cannot find module '@routersV1/users/usersRouter'

package.json

"_moduleAliases": {
 "@routersV1/*": "./src/routers/v1/*"
}

Nodejs: v18.13.0

@qxb3
Copy link
Author

qxb3 commented Mar 26, 2023

@girixcode7 i didn't i instead use this: #113

@ugeshgupta000
Copy link

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

4 participants