-
-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix path to global node_modules on Windows #5
Conversation
I think you should squash the commits. |
@jorrit I can squash the commits on merge, no problem. However, @kuksikus can you share any additional insight into when Since npm itself seems to only use thanks! |
@jonschlinkert I found the problem with path on Windows, and found this path in process.env while debugging. A quote from the npm wiki:
If I try "npm ls -g" I see "C:\Users\jibon\AppData\Roaming\npm" and list packages.
|
thanks for the detail! I'll merge sometime today |
👍 |
I squashed commits |
Isn't it an idea to just read the output of [edit] |
yeah I was thinking of doing something like that to get custom prefixes. |
I think it's a bad idea, beacause |
I think it should only be executed once and cached in |
that's why I haven't done it yet lol, I mentioned how slow it is somewhere else. I'm very open to suggestions. However, it's also ridden with edge cases apparently. Any suggestions? |
I don't think caching it is a good idea if you consider some common use cases for custom prefixes |
You mean that the prefix changes while the application is running? |
yeah you're probably right. I'm overcomplicating it. fwiw I almost always cache file paths anyway:
the closest lib I've found to what I'd like to use is https://www.npmjs.com/package/rc. seems like a nice lib, but it seems like swatting a fly with a hammer in this case. Preferably someone knows of a lib that simply resolves custom prefixes. If not I might create one |
I think custom prefixes it's a different story. AFAIK current lib doesn't work with default prefixes on Windows. Maybe solve this problem at first? :) |
@kuksikus I think you're right. The current patch greatly improves the current situation. |
sorry for the delay. thanks @kuksikus, published and released as 0.1.3 |
process.execPath return path to instlled nodejs on Windows, but not to global node_modules directory.
E.g. package npmls use global-prefix for getting path to node_modules, but it's returned wrong path.