I see you can download nodejs
via homepage
or install via homebrew
or via macports
.
which is the best method?
Is there a reason for choosing one over the other?
Some things I consider:
1. Ease of upgrading to latest version
2. Ability to (fully) remove and uninstall
3. 1 and 2 should leave no trace of old version (including any temp files), or in case of uninstalling, should fully remove everything.
You should have some familiarity with the Mac Terminal application since you'll need to use it to install and test Node and NPM. You'll also need the Terminal to use Node. js and NPM. The Terminal application is located in the Utilities folder in the Applications folder.
To write and run a NodeJS program on mac, first download and install the LTS version of NodeJS from its official website. After installation, create a new JavaScript(. js) file, write some code inside it, and run the “node fileName. js” command in the terminal.
I prefer to use brew
.
once installed its as easy as:
brew install node
Done and done.
Don't want it anymore?
brew uninstall node
Need to upgrade?
brew upgrade node
Plus, its based on git
and the community is very active.
Furthermore, the packages that are installed are always in one place, then symlinked to your /usr/local/bin
, so no messy sudo
or multiple install locations.
Checkout the site here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With