News for hackers. Stuff that matters.
Re:Why can't I write code inside my browser? by colejohnson66 on Friday January 15, 2021 @03:06AM (#25788222)
My question is: why can’t the Node installer add /usr/local/bin to the path itself (if needed)? Why force me to do it? The Windows installer did it for me. I can just type `node` or `deno` into PowerShell and it loads up a REPL. I never had to add them to `PATH`.
Re:Why can't I write code inside my browser? by MauranKilom on Friday January 15, 2021 @12:58PM (#25793817)
node puts relevant binaries into /usr/local/bin because that's just how you do things. Whether or not that path is in $PATH is none of node's business, and if you (for whatever weird reason) work on a system where that's not the case, you probably wouldn't want the node installer to mess with that.

Note that the installer is not saying "please make sure /lib/node.js/ is in $PATH" - this would certainly be something to expect the node.js-specific installer to set up by itself.

Re:Why can't I write code inside my browser? by jeroenhd on Friday January 15, 2021 @05:30AM (#25789174)
On what platform doesn't it? I've installed node on Windows and various flavours of Linux and I've never needed to extend $PATH for it. Is this a mac thing?
Re:Why can't I write code inside my browser? by aspaceman on Tuesday January 19, 2021 @09:12PM (#25841763)
It expects /usr/local/bin/ to be on the $PATH, and so it adds itself to that location.

It doesn't know if you purposely meant to remove it's install location from the PATH, so it doesn't re-add it.

It could do what you ask, but this requires setting the $PATH. The most common way to do so is modifying bashrc, but now you're modifying the user's bashrc. Now you ask, is the user using bash? Maybe you're using the fancy whiz-bang ohmyzsh since that's what Medium told you to do, and now that doesn't work either.

If you keep /usr/local/bin on your $PATH (which is standard in most 'nix installations) then you don't have to change anything or do anything. Why do _you_ have such an abnormal system? We can play this game all day and it's fucking miserable. Just learn how to use your tools for fuck's sake.