I'm trying to install a set of software tools, the "PureScript compiler", on my Mac. I actually installed an older version with npm, like

sudo npm install -g purs

I need to get the latest version, and it seems to be available only as a direct download from here: https://github.com/purescript/purescript/releases and not yet available through npm.

Right now, the old version of purs is in /usr/local/bin. Should I just download this new version and copy it there? Or is there a better way to install this?


You cannot install to /usr/bin because that directory is protected by SIP

However, /usr/local/ is not covered and you can write to that directory. Using /usr/local/bin is perfectly fine for what you're attempting to do as it's both writeable and in your PATH environment variable.

  • 2
    Amen to using /usr/local and a nod to using brew.sh to get node and other tools set up in the local space in the first place. Then you can use npm and such to add on that location. – bmike Jun 13 '18 at 22:13

I had an issue installing to /usr/bin, even with sudo. I had to ensure sudo was used on all commands that needed it:

  • This works: sudo curl -L https://git.io/rustlings | sudo bash

  • This doesn't: sudo curl -L https://git.io/rustlings | bash

  • ˋsudo curlˋ is not required, piping an unverified internet download into a root shell poses quite a security risk though. – nohillside Nov 26 '19 at 15:33
  • Oh yes, I tested it, and that is not needed. Thanks – ZenBoat Nov 26 '19 at 15:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .