nodejs.org icon indicating copy to clipboard operation
nodejs.org copied to clipboard

Bash script on downloads page uses a command that is not installed on Mac

Open focarroll opened this issue 4 years ago • 4 comments

By going to the link above, you can see the following code:

curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg"

This bash script uses the command wget. However, Mac OS does not come with wget, meaning that this cannot be used.

focarroll avatar Mar 11 '21 14:03 focarroll

After some trial and error, I've found a possible solution for Mac users:

curl -O "https://nodejs.org/dist/latest/$(curl -s https://nodejs.org/dist/latest/ | grep "pkg" | cut -d'"' -f 2)"

focarroll avatar Mar 11 '21 15:03 focarroll

Thanks a lot sir

aldarmak avatar Apr 04 '21 12:04 aldarmak

Can I update it? @aldarmak

MrJithil avatar Apr 29 '21 11:04 MrJithil

"https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.>node-(.).pkg.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"

zelma83 avatar Feb 12 '22 21:02 zelma83

is this issue still open ?

mwenku avatar Feb 14 '24 14:02 mwenku

the command don't refers to the issue is no longer present on the site, so you need to check whether it's still relevant.

EDIT: wget still not on macOS. And command still have wget

AugustinMauroy avatar Feb 14 '24 18:02 AugustinMauroy

Finally

focarroll avatar Feb 16 '24 20:02 focarroll