pnpm: pnpm install -global doesn't create symlink to /usr/local/bin
pnpm version:
2.15.0
Code to reproduce the issue:
waylandchan@bctmac ~/sandbox/orderbook$ which tsc
tsc not found
waylandchan@bctmac ~/sandbox/orderbook$ pnpm install -g typescript
Packages: +1
+
Resolving: total 1, reused 1, downloaded 0, done
/usr/local/Cellar/node/10.9.0/pnpm-global/1:
typescript 3.0.3
waylandchan@bctmac ~/sandbox/orderbook$ which tsc
tsc not found
waylandchan@bctmac ~/sandbox/orderbook$ pnpm --version
2.15.0
waylandchan@bctmac$ ~/sandbox/orderbook$ node --version
v10.9.0
waylandchan@bctmac$ ~/sandbox/orderbook$ npm bin -g
/usr/local/bin
waylandchan@bctmac$ ~/sandbox/orderbook$ pnpm bin -g
/usr/local/bin
waylandchan@bctmac$ ~/sandbox/orderbook$ ls -al /usr/local/Cellar/node/10.9.0/bin/tsc
-rwxr-xr-x 1 waylandchan staff 2857 Sep 4 18:55 /usr/local/Cellar/node/10.9.0/bin/tsc
waylandchan@bctmac$ ~/sandbox/orderbook$ date
Tue Sep 4 18:56:06 HKT 2018
Expected behavior:
I expect the ‘tsc’ binary to be installed and present on my current path, which it isn’t. My guess is that there should be a symlink from /usr/local/Cellar/node/10.9.0/bin/tsc
=> /usr/local/bin/tsc
Actual behavior:
The pnpm i -g typescript
only gets installed to /usr/local/Cellar/node/10.9.0/bin
Additional information:
This bug was first reported in Issue 695
node -v
prints: v10.9.0 OSX High Sierra 10.13.5
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 7
- Comments: 36 (10 by maintainers)
Commits related to this issue
- fix: fixing issues with global install PR #2637 ref #1360 — committed to pnpm/pnpm by zkochan 4 years ago
The latest version of pnpm should have fixes for all these issues.
I don’t know if it’s the same issue, but
--global
isn’t working correctly on Windows either. Packages are being installed toAPPDATA
even ifprefix
is set:Hey @zkochan Don’t work in 2.15.3 either, I tried same couple of months ago and it was not working even then. So I moved back to npm.
OSX High Sierra 10.13.6
I published a fix. You can install it via:
npm i -g pnpm@dev
.Let me know if it solves some of the issues.
Trying to figure out the location of the global npm bins seems to not work well. Setting
pnpm-prefix
is not very user friendly. Finding the right location for the bins is super hard because there are different OS and toolings.I think we can try the next solution:
I’d just like to report that I haven’t noticed an issue with this since the reported fix, so a thank you!
How do I gain full explicit manual control over where binaries are installed/linked? Instead of fixing corner case after corner case in the complicated logic that tries to figure out the executables location by itself, why not let the user circumvent the issue completely and specify the location imperatively?
The issue here is that I CANNOT FOR THE LIFE OF ME convince pnpm to install binaries somewhere I have write permissions to, and I can’t use sudo because I want to install from a private github repo and root doesn’t have my keys!
Any updates? I really want to switch to pnpm but the global install issue block me. I first meet this issue one year ago, now one year passed but it seems we haven’t make any progress on this.
@ExE-Boss did
pnpm-prefix
solve the issue in your case?why not a default
pnpm-prefix="$HOME/.pnpm"
, then:We can just
export PATH="$PATH":"$HOME/.pnpm/bin"
… (we can also edit the sys env in pnpm postinstall script)Also ran into this issue. Coming back to
pnpm
after briefly trialing it a few years ago when it was fresh and understandably rough around the edges… disappointing to see some aspects still don’t work properly.Maybe this is the real issue here? Either way it needs fixing… Homebrew is by far the best way to install things on macOS.
I’m installing
pnpm
for the first time and encountering this issue. The recommended install commandnpx pnpm add -g pnpm
fails to symlinkpnpm
. My Node is installed viahomebrew
.Also I had to dig reallly long to find about
pnpm-prefix
it definitely should be added into the docs, i guess here (?): https://pnpm.js.org/en/configuringI still can’t use pnpm to install globally either on Win10. I am using node installed via
nvm
, so directories are wonky, but nvm -g works fine…still seeing this on 3.4.1.
Edit:
Appears this might be an issue with node being installed via brew (though I was sure I hadn’t installed via brew, because I knew that could cause issues). Once I used this script, pnpm is able to set it globally