-
Notifications
You must be signed in to change notification settings - Fork 71
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: download prebuilt binaries when installing with pnpm #66
Conversation
A better solution to detect the running package manager might be to use which-pm-runs. It gets the package manager info from |
We could use it if you like and think it's the preferred way of doing it. |
I updated the code. I think it is more reliable because sometimes a package manager can be installed via an alias. Like npm has npmc for instance, so the execPath might not contain the package manager name. However, that's probably a rare situation right now. I am fine with both solutions. |
@zkochan I prefer using your module and also prefer inviting you to prebuild org if you're cool with that |
bin.js
Outdated
|
||
if (util.isYarnPath(execPath) && /node_modules/.test(process.cwd())) { | ||
try { | ||
var pm = whichPmRuns() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If whichPmRuns()
threw an error instead of returning undefined
this could be
try {
isNpm = whichPmRuns().name === 'npm'
} catch (err) { }
@zkochan WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I checked which-pm-runs
and it won't ever fail, so I simplified the code by removing the redundant try/catch
@ralphtheninja awesome! I am cool with it |
Nice! Invitation sent. Sorry for the delay, was traveling yesterday. |
Just need at least one more maintainer to have a look and then we |
2.5.1 |
Like Yarn, pnpm does not add a
_from
field to thepackage.json
files of the installed dependencies. So pnpm needs the same workaround as Yarn