Bash script on downloads page uses a command that is not installed on Mac
- URL: https://nodejs.org/en/download/package-manager/#macos
- Browser version: Google Chrome 88.0.4324.192
- Operating system: Mac OSX 10.15.7
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.
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)"
Thanks a lot sir
Can I update it? @aldarmak
"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 "/"
is this issue still open ?
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
Finally