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

How to use the modules-alias with lerna ,it is unused in a lerna project. #120

Open
radiorz opened this issue Aug 2, 2021 · 2 comments
Open

Comments

@radiorz
Copy link

radiorz commented Aug 2, 2021

I use lerna to manage my project.and the nodejs server is one of packages. I run the script on the root

npm run my-server dev

and it return a error :

Error: Cannot find module '@/...'
@brillout
Copy link

Same problem here. Did someone find a solution?

@flyingbirdhub
Copy link

For now, you can use like that:

`import { init } from 'module-alias;

init({
base: 'Path to your package.json'
});
`

do not use import 'module-alias/register, as said here https://github.com/ilearnio/module-alias#using-within-another-npm-package

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