-
Notifications
You must be signed in to change notification settings - Fork 14
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
default prefix not resolved when using Brew to install node #7
Comments
I will open a PR with the proposed change. |
Great! Thank you! |
Fixed in: #6 Closing. |
Actually this wasn't fixed by #6 . I still need to create a PR. I started work on this but had to switch priorities and forgot about this. |
oh! fast reading... I was confused. Re-opening. Thanks! |
it seems the issue is rc('npm').prefix here. If the prefix is not explicitly set in npmrc. the builtin prefix will not be picked up. manual set in ~/.npmrc will fix. |
Yep, running |
When node is installed using brew, the
process.execPath
isn't/usr/local/bin/node
, which causes the default prefix to be invalidly resolved.According to the npm config documentation, the config is resolved from the following places:
The problem is that 3) & 4) are not possible to figure out without resolving the location of
npm
. Therc
package will only find the configs in 1), 2) and sometimes 3) depending on the prefix.In particular 4) caused issue #4 on Windows, which was solved by hard coding the content of the npm builtin prefix config.
Unless someone has a better suggestion, I suggest that we hard code the default prefix location on all platforms, similar to Windows.
This shouldn't have an impact since after #6, the resolve process first tries using prefix and then using the
process.execPath
anyway, which means that even if we hardcode the wrong default prefix, the execPath based resolution will still happen as it currently does.The text was updated successfully, but these errors were encountered: