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
Wrong app root path on Windows with scoped packages and nvm #20
Comments
Can you post what |
I'll hand it over to a colleague whom I asked this for. |
Hi, require('module').globalPath contains:
Regards, |
Thanks, Frank. I'm not entirely sure how |
Hi Chris, [ '"C:\Users\jane.doe\AppData\Roaming\nvm\v6.7.0"', appRootPath.path is still set to "C:\Users\jane.doe\AppData\Roaming\nvm\v6.7.0". Remember: the module is globally installed:
Hope this helps. Thanks, |
I have the exactly the same problem (equivalent paths also), but I'm not using nvm or scoped packages. I'm not sure, but maybe this isn't related to the new "npm flat design packages"? |
Any update on this? |
Still experiencing this. Any updates? |
I have globally installed a Node.js application on Windows, where Node.js was installed using nvm-windows. This works.
What's unusual about my scenario is that the module is a scoped one, i.e. there is an
@org
prefix in its name, which results in an additional directory. So the path looks like this:C:\Users\jane.doe\AppData\Roaming\nvm\v6.7.0\node_modules\@org\my-app
This is the application's root path. Now inside of this application I am using a module. It gets installed to the application's
node_modules
directory, so we end up with:C:\Users\jane.doe\AppData\Roaming\nvm\v6.7.0\node_modules\@org\my-app\node_modules/my-module
Now, this module uses
app-root-path
to get the root path of the application.The expected result is:
C:\Users\jane.doe\AppData\Roaming\nvm\v6.7.0\node_modules\@org\my-app
The actual result is:
C:\Users\jane.doe\AppData\Roaming\nvm\v6.7.0
Obviously app-root-path detects the root path in a wrong way, but I am not sure why. It may be that it is because of the additional
node_modules
directory (which, I guess, is caused by nvm on Windows), or it may be because the application is a scoped packages.Unfortunately, as I am not really sure about the cause, I can not provide a fix. Any ideas on this?
The text was updated successfully, but these errors were encountered: