What is the Best, better Way to Install Node.js, NPM on a mac?

Hello! as it says above.

I’m pretty sure this could either be ignored, or start a flame war.
…or I’ll be totally blown away by everyone agreeing on one way!

But
Macports…
https://www.macports.org/

Homebrew…

… the stand alone Installer, made by the devs themselves?

Dis/Advantages of these 3 methods (are there more? heaven forbid!)

I’m Concerned about Privilege/damage escalation with regards installing packages etc that I dont really understand or know little about but are deemed necessary when installing things and trashing, BLOATING my systems up . I don’t have endless disk space, due to having multiple partitions.

Or being stuck at some command line, Verbose Horror that is beyond my grasp… and this is someone elses computer Ive borrowed…so dont want to send it back as a basket case, or reinstall and loose stuff.

AND… I’d like to be able to maintain it… get rid of it all… update it… NOT have multiple, unnecessary versions on my system - unless I know what Im doing with regards some task,
and NOT… have bloated systems.

Did I mention BLOAT enough times?

And to Get rid of it!
I looked into how easy it is to remove and found several references to a defunct website , that I managed to find on Archive .org

So for HomeBrew.
First I need to Install X-Code… WHAT!!?.. oh ok, just the command line tools then. I guess that’s ok.

Then Install HomeBrew itself

Then, I can install NODE.js

Or Macports… I mean, I dont even know which of these…
https://ports.macports.org/?search=node&search_by=name

SO, who uses what?
Homebrew looks like the new kid on the block compared to Macports (which has far more stuff)

And I’m aware that Brew, REPLICATES and adds stuff that are already on my mac, but keeps them seperate and different versions (ie, SQL, Apache etc)

Where as Macports uses my system versions…
Unless… Im wrong!

So in order to play with this fine new plugin by @ehigiepaul , Ive to do this.
BUT… not sure about using the actual node installer as it uses SUDO for quite a bit of the install…
Apparently…

SO, who recommends what?

Its now Horsey O’ clock on Planet *frozen Wales (now with added rain)
SO I’m off and will be back later to have a look and see who advises what?

The easist option to just do it, would be the stand alone installer.
I guess Homebrew next (but I then end up with multiple installations of already present system resources)
Finally Macports (which USES my existing system resources…available apps. Ha! no duplication, buuut Could then nuke those very same system apps that I rely on for other things)

Dilemma!

This… is why Ive never installed Node…

Not going to chime in quite yet, but have you ALSO considered yarn? :grin:

@schpengle,

Don’t be distracted by all that info! Just download node.js and install. NPM get installed with it. That’s it!

Now when you open the terminal (when Paul managed to get it working!) you have NPM also open it’s in the terminal waiting for instructions from you. I will put out a short tutorial with a build system that installs Bootstrap 5, browser sync and SASS in Pinegrow easy peacy. (if I get it working :wink:) You have to see it to understand it.

The only problem I see is that you always need to have a page open to make it work and it would be better if the terminal worked without anything open so you can build from scratch. There is maybe a trick for that I don’t know! Besides using a dummy page.

Normally I use the system in Sublime Text, but if the terminal works in Pinegrow it must be possible to recreate it in Pinegrow.

@RobM , yes,… option 4… thanks … :stuck_out_tongue:
Feel free to chime like a gong later on…

And it is tempting @AllMediaLab , its just that with HomeBrew, I hear all this stuff about installing packages to do stuff build tools… GULP… SASS (like you just mention) …minification, image resizing etc etc.

Even though PG does the SASS thing itself. which is fab… when I get around to SASS.

Ive been on this fence for a couple of years, so of course, have done nothing.

Tall fence, nice view though.

SO, HomeBrew… a package manager… to install NODE… a JS … package manager…

and now to look at YARN… and I know I’m NOT supposed to install both MacPorts and HomeBrew.
FUN.

EDIT… UPDATE…whatever. …NVM … whaaa?

OK
YARN!

So… ANOTHER package manager… to replace… NPM…Node, Javascript package manager… as its supposed to be better/safer, which is installed with …HOMEBREW… er…package man…ager.

Am I Still with the program here?

so , this looks like a good summary and way to go, with the potential to shrivel up my hard drive like a sun dry tomato!

What is the consensus on that set up?
SO that is

XCODE command line tools,

NVM…

.er …Different VERSIONS of Node… nice, a VERSION manager, as opposed to a PACKAGE one.
Homebrew, package manager, (For GULP et al) so that goes awry right off the bat.

So. we use THIS to actually install

NODE.js …

(Oh yeah, that’s what I was doing. This is all your fault @ehigiepaul :-p) hee hee.

YARN…

package manager (FACEBOOK!@@>…spits… then spits some more… ) supposed to be better, safer, faster than NPM…so this actually installs the JS Packages into NODE?
… which I guess I need to get this Plugin to work.

Then He suggests installing and IDE - well blow me! I actually have that (Spits a bit more)
MS

Visual Studio Code

… and set up that with the command line after path variables, profile, yadda yadda.

BUT… I’m still interested in the SUBLIME Text build tool /set up @AllMediaLab , as I used that a lot on my previous OS, (nothing too productive of course) and like most everything about it and its TINY AND FAST compared to VS CODE, ATOM etc etc. and just so slick.

…still waiting for the ST editor Plugin for PG… cough cough.
SO that could be your next Project @ehigiepaul , if you fancy, after putting me through this :smiley:

hee hee.

So, we now have ANOTHER 2 things to install.
As opposed to the simple NODE.js installer.

But is this malarky better for the future, IF I get this all together and start productively doing something?
Worth the hassle?

That guide from 2018 seems Nice and straight forward.
…I mean… what could go wrong?
:neutral_face:

Or that simple NODE.js installer.
But I mean… this system doesnt even have GIT installed… ALSO…now owned by MiCroShaft.

I’m running out of spit.

1 Like

Homebrew is a perfect package manager for Mac and Linux, but they basically do the same thing. For on my Mac I could use it too but till now never tried it.

OK… the Ball is rolling…

  1. X Code command line tools -installed - CHECK!
  2. Homebrew, via /bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)” Check
    …Happening as we speak…er…over my mobile phone Internet connection… I may be some time.

But I DO now have

git version 2.20.1 (Apple Git-117) installed care of CLT. But I suppose that may be getting updated…

Ok… after perusing… I shall NOT use HomeBrew to install NVM…to manage my node versions.
As… it aint really recommended, definitely not by the NVM devs.
As explained here.

SO! scary command line NVM install it is then, aka, this site.

something about all GItHub pages and installing the contents thereof that…just…make my buttocks … clench!

Update
Super! NVM installed, running and 2 versions of Node installed via it - REALLY QUICKLY.
The most current and the latest LTS (long term service).
wow.

This is nice… now onto Yarn… to replace/augment NPM

Update ok… holding out on YARN at the mo, as there seems to be quite a bit of cafuffle around Yarn 1… Yarn 2… breaking changes etc etc.

I’d have guessed to go with Yarn 2…bbbbbuuuuuut then I found ANOTHER packge manager…
WIth flat tree dependancy, ie, just downloads something once… for a hundred projects that all use it and links to that one resource… not downloading it 100 times!

PNPM

…anyone using/heard of this, feedback/comparisons?

aaaand since Im on the topic…

ok,… off topic with regards to NODE… but that is now in the can,
Just an efficient package manager to find but on that route there is

Bower

how relevant is this today?
I rather fancy the way it says it does nothing, runs nothing, other than collate resources, but that these may be html, css, images, all sorts.

Who uses this much and links to good resources. you guys recommend, or STAY AWAY advice if you have had horror storys.

I also like the fact it has a pretty colourful bird and site :slight_smile:
it appeals to my inner child, since my inner geek appears to be somewhat deceased.

Hi Ian ( @schpengle ),

regarding Bower, this is what my favourite package installing, language compiling, concatenating, browser refresh and sync, or all in one Swiss army knife says (since about 2 or 3 years now):

Cheers

Thomas

Oh thanks.
And cheers for that picture!

Im checking out the website, i saw no mention of lack of development.

I was also looking at codekit, amd webpack etc, didnt realise Bower was in the first.

Cheers

EDIT
oh, and this was the nicest, simplest intro to Bower I found, its pretty dated now, but it seems handy!
At this nice simple level.

This best way is to download the install for mac.
Simple and easy pkg installation.

I just found out when I got my old 2009 macbook pro out of the dump room.
And I installed v14 and it worked on Yosemite Os.

yep but your stuck with that one version then, system wide, if. you want to test other ones and its a pain to remove.

thats why I used NVM in the end :slight_smile:

and GOOD NEWS

if you go here

http://dosdude1.com/software.html

you can update that 2009 macbook , right up to Mac OS X 10.15 - Catalina!
woo hoo.
Right, horses, VERY late!

1 Like

Ok, still been looking into all this and setting up.

I decided that installing NVM via NPM was the better way to install NODE, as I could easily swap to different versions of NODE for testing, via NVM.

I then decided to drop NPM, as it seems incredibly dumb in that it DUPLICATES a projects dependancies in EVERY instance that uses it.

WHAT?>

yes, so if you are developing a Node based app (Hello PineGrow Devs)
EVERYTIME, you set up a new version/development/project… it downloads ALL THE STUFF AND MOUDULES AND DEPENDANCIES… (yeah. lot of bold type there)… AGAIN!.

even though you have downloaded it all once before.
GAh!

PNPM (Performant NPM) does it …once!
and links all the other projects to it.

So, to answer my own question, answer is

  1. use NVM
  2. Ditch NPM and install PNPM

as well as that, when looking into Packet Managers…
I realised that …going back, as far as 2017, the BOWER devs themselves… were advocating… using other tools to do their job!
oh!
bugger

ie,

so even though, installs look constant…

and this is years later…

I might take their advice when starting out myself
and am going to check out

Webpack

(I barely understand their own description of why they are a good choice.
…thats promising… :-/ )

and …Parcel

but… I still like the look of Bower and i THINK it is still in Yeoman (not got any deeper with that yet)
https://yeoman.io/

or it might not be!

so feel free to update/advise me.

…and I obviously prefer tools with happy smiley cartoon characters and fluffy animals , in bright colours on their web pages… sigh

So build tools with instructions in crayons and the Comic Sans font are undoubtedly welcome in my workflow
:slight_smile:

AND…

While perusing these and discerning which did which , what to use for what, and noticing the duplication and apparent redundancy of some tools,

This was helpful

and even as interesting is the fact that the chosen answer was changed a few years later!

And there are only TWO real answers there!
SO that’s a win

and this is a GREAT explanation of this…hitherto unseen world and what does what