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
Path resolution in npm linked modules report module and not root app path. #33
Comments
npm link
-ed modules report module and not root app path.
The cause is using If a module is It makes using |
Ran into this issue in an npm module I was developing. It worked great when actually npm/yarn installed, but not when linked. I ended up just creating a workaround option in my package for project root. However, it'd be great if there was a fallback if linked to somehow get the running project's root. |
same issue here( Does not work when creating custom package for npm, it starts referring to the package project directory. |
I have to share an interesting bug that caused an outage and took me a long time to figure out and is directly related to this issue: Basically:
Exactly like what @Jorgechen said. |
Same problem with pnpm workspaces. Temporarily, I solved the issue by defining a "scripts": {
"dev": "APP_ROOT_PATH=`pwd` my-dev-command"
} |
I only noticed this today when changes in
globby
starting throwing path errors, so might have been there a while and I just didn't notice.Under node v11, working in an app with the following pattern:
app-root-path
is used in each shared lib. When these are installed withnpm install
, the libs correctly report the app's root path. In development, when the libs are linked withnpm link
,app-root-path
reports the root path of the lib module, not the app.The text was updated successfully, but these errors were encountered: