In order to get anything working on my Mac I will have to install NodeJS as well. You can download it here : https://nodejs.org/en/
Here you can find 2 buttons. The left one is the most recent stable version, the right one is the very latest version which may contain some issues. I installed the stable version (Recommended for must users).
It downloads a .pkg file to my downloads folder. Run it, follow the wizard. After completion the installer comes with this notice :
“node” and “npm” are not folders, they are executables. They don’t just show up in your applications folder on your Mac. Let me show you where they are.
Open up a terminal window on your mac and type “ls”. This is the list command that shows you the content of a folder. You will see all of the folders of your home folder. That’s all of the information where your personal documents are saved : documents, images, desktop, music, etc.
That’s not what we want. Your home folder is actually a folder, somewhere deeper in the folder structure on your drive where there terminal automatically jumps to for your own convenience. In order to go to the root of your folder structure on your mac type “cd /”. The “cd” command means “Change Directory”, and it just means browsing to another folder. The slash sign behind it just denotes that you want the terminal to go to the root folder.
If you type “ls” again you will se a lot of other folders, one of which is “bin”.
type “cd /usr/local/bin/”. You change to the bin directory where “node” and “npm” are installed.
then type “ls” again, and you will see them listed.
Let’s give it a shot.
After the “>” prompt, type
If everything’s alright, you will see the terminal respond with “hello world”.
to get out of the “node” command line utility you need to press ctrl+c twice.
The other utility in this folder is called “npm”, which is short for “node package manager”. NodeJS comes with a lot of additional modules you can install separately. These modules are contained in packages, and the “npm” tool is responsible for managing those packages.
I’ll be coming back to “npm” in later posts, but for now, just know that there are tons and tons of packages you can download for free. You can find them on this url :
But you can use the “npm” tool to install them as well if you now the name of the package. Have fun browsing!