How to Install Node.js on MacOS for Beginners, Using the Node.js Installer

How to Install Node.js on MacOS for Beginners, Using the Node.js Installer

Here’s a quick walkthrough to help you understand how to install nodejs on your local computer, using the node.js installer provided on the nodejs.org website!

My installing node.js pain is your installing node.js gain.

Have no fear, I’ve been writing tutorials like this for a many years and excited to make this an easy way to learn how to install node.js on your macbook, macbook air, macbook pro, or whatever the hell they are calling the thing you’re using.

Our goals;

  1. Download node.js
  2. Installing node.js on your mac
  3. Making cool apps in node.js

We may not get to making cool apps today, however with some time, who knows what you can develop.

Download Nodejs from nodejs.org

Below I leave all the information for doing the node.js installation on multiple computers. I’m anticipating the blog will become my personal wiki.

Ready to download? Follow here to download node.js. If you are concerned of 32bit/64bit, more below, if not concerned, skip the next section.

Pick Mac operating system 64bit for any recent model computers.

You are aiming to download the LTS or “recommended for most users” version and it needs to relate to your computer. Consider we designed our blog for “MacOs” users.

a screenshot of nodejs.org, demonstrating what to click to download the macos installer .pkg for 64bit system

Maybe you are not sure if 64bit?

Determine what your computer needs for node.js installation

To install most things now-a-days on your little computer or big computer, requires understanding more about the computer. Crazy concept.

Take a peak, top left is an apple.

Click the apple.

top left of each monitor will be an apple to click.

Research shows if you have a computer >2007 from apple, it’s 64bit.

If the processor is an Intel Core Solo or Intel Core Duo, it’s 32-bit only. Here are the 64-bit Intel processors Apple has used in the Mac:

  • Core 2 Duo
  • Dual-core Xeon
  • Quad-core Xeon
  • 1 – Core i3
  • 2 – Core i5
  • 3 – Core i7
  • 4 – Core i9

Hopefully this helps you understand enough to make a quick next step. If not, leave a comment below and happy to offer help with your node.js install on your mac, as best as possible. By leaving a comment, I will be offer you help immediately. Offering you a chance to get past this hump quickly.

Download options for node.js

Latest LTS Version: 12.19.0 (as of oct 8,2020)

Download the Node.js source code or a pre-built installer for your platform, and start developing today.

Windows Installer (.msi)32-bit64-bit
Windows Binary (.zip)32-bit64-bit
macOS Installer (.pkg)64-bit
macOS Binary (.tar.gz)64-bit
Linux Binaries (x64)64-bit
Linux Binaries (ARM)ARMv7ARMv8
Source Codenode-v12.19.0.tar.gz
(relevant as of oct 8,2020)

Additional Platforms for node.js to be implemented

SmartOS Binaries64-bit
Docker ImageOfficial Node.js Docker Image
Linux on Power LE Systems64-bit
Linux on System z64-bit
AIX on Power Systems64-bit
(relevant as of oct 8,2020)

Screenshots of node.js installation!

I’ve found screenshots really help me see something at a glance and offer a medium of information that isn’t a big commitment.

For some reason, some days I don’t want to watch a video of someone doing a clickthrough. I have a good groove going and I need to keep my music on loud.

Did i mention installing node.js on macOs is easy? you got this.

You need 75.5mb of space to install node.js on your macos
i could change the directory but i wont because i have no idea where else to install node.js right now
needs your password to install node.js on your macos, no that’s not the amount of letters required to do my password, i do mores
writing files… yikes… i didn’t sign up for this… yes you did… almost done installing node.js on your computer… time to dance?
These bins look relevant and it’s suggesting that we add this to our $PATH, a good suggestion if we want to use it in the terminal I bet, unless we want to add these in front of the terminal command… here we go
okay, your node.js installation on your macos is completed, now move the installation thing in the trash, and if you need it again you can always open the blog and open it. i know ill be saving it as a favorite because chances are high i will need to reinstall my node.js, maybe keep it.

Will insert new content here, as I progress learning more about node.js.

Thanks for checking out my blog on how to install node.js on macos for beginners, using the installer from nodejs.org.

Stuck on your journey? Need advice? Add me on twitter.

How to Loop your Code | PowerShell Looping

How to Loop your Code | PowerShell Looping

Here’s one way to loop your code with PowerShell. PowerShell looping is one of the easiest ways to loop through processes in code and a good way to start learning to iterate little processes you develop.

A rather typical procedure to learn early or it won’t make much sense when down the rabbit hole. I like how this code writes and teaches you how to iterate rather quickly. Be sure to paste and hit play.

$k= New-Object -comobject "Wscript.Shell"

$a=1
$b=5
$n="`n"

Start-Sleep -seconds $b

DO
{
$k.sendkeys("1 of $a$n")
$a++
Start-Sleep -seconds $b
} While ($a -le 5)

There are lots of ways to do things in code. Maybe you loop things differently?

But PowerShell keeps it rather simple.

When you’re wanting to loop text output, you can do so easily with Powershell using a DO WHILE.

do while loop in powershell-Windows PowerShell ISE

Here’s a loop we can use to repeat stuff in PowerShell.

Found the beginning of this lesson here, meaning I found code, copy pasted it, and it was enough to help me learn every aspect of the code. The lesson @ the Microsoft website is a little more extreme and doesn’t explain the line by line code, which I feel needs an extra explanation.

Line 1
$k= New-Object -com "Wscript.Shell"

New-Object Creates an instance of a Microsoft .NET Framework or COM object.

New-Object Opens the ability to send a keystroke within PowerShell.

We call this with $k moving forward.

Like in math class, you used X to represent a value or Y to represent a value.

This makes our code easier to write and read.

$k.sendkeys, later in the script, is now easier.

-comobject or -com for short is a special ability.

The -Comobject Specifies the programmatic identifier (ProgID) of the COM object. Luckily you don’t need to understand what this means.

Line 3,4,5
$a=1
$b=5
$n="`n"

Like in math class, you have X representing a value and Y representing a value.

We will use these extra variables later in the tutorial.

Today, $a and $b represent a tiny lesson, which is.. you can leave unused code.

$n="`n"

This tells PowerShell to make a new line whenever we say $n in our code. So when we output keyboard key strokes of “something $n” — powershell essentially hits “ENTER” on the keyboard. This is a powerful next step for anyone looking to automate their UI.

Line 7
Start-Sleep -seconds $b

Ever tried living without sleeping? Writing UI automation is the same. You need breaks, waits, pauses, etc.

In powershell, it’s called Start-Sleep -seconds X…

Line 9,10,11,12,13,14
DO
{
$k.sendkeys("1 of $a$n")
$a++
Start-Sleep -seconds $b
} While ($a -le 5)

Here’s the full loop, a beautiful little tool that we can use to do very quick simple tasks, or loop massive dynamic scripts. Maybe it emails someone something every 15 minutes. Like a scheduler, you can pad a pause into this loop and expect the loop to repeat at the speed you desire.

So, not only are we saying something with our sendkeys tool, but we are also padding a pause into the tool.

If you want to learn more about the sendkeys tool, I built a blog called Make Your Computer Type For You in Powershell. Where I discuss that tool more. Let’s continue.

Line 9,10,12,14
DO
{
$a++
} While ($a -le 5)

DO this work until X equals 5.

-lt is less than, and -gt is greater than. -le seems to be another operand and I cant seem to google it today. what’s nice is this code takes a split second to run. Test and use what works best for you.

$a++ is thing that increases. Per loop.

So the first run, makes the $a=1.

The second run, makes the $a=2.

The third run, makes the $a=3

4th, $a=4

5th, $a=5. Now the condition at the end stops the loop and continues reading the rest of the code.

After it repeats the loop 5 times.

It knows it increases once because of the $a++ logic we built.

$a++ effectively increases, +1, each time. It also helps us stop our loop from running forever. If you remove $a++ the loop will keep running into you end the script. Which means this could be a bit risky when pointed at the wrong or right thing.

And the condition…

1 -le 5

2 -le 5

3 -le 5

4 -le 5

5 -le 5

END… now the rest of your code would be computed.

 

Make Your Computer Type For You in PowerShell

Make Your Computer Type For You in PowerShell

Hello, here’s a quick tutorial on how to make your computer type for you in PowerShell on Windows.

Have you ever needed to type something on a computer?

Over and over.

And maybe you did not want to repeat that task.

This script is for you.

Making your computer type for you is the usual first step to learning how to make your computer do your work.

Also, the first step into getting started with UI automation.

What is UI AUTOMATION? An entire world of easy tools, that make your life easier the more you learn.

The goal here is you want to learn how to automate something that you are doing manually.

This kind of automation should be used to put yourself out of work so that you can get your life back with your family.

You can open PowerShell ISE, it’s a code editor.

Powershell ISE is a free app to help you develop code in Powershell. AKA Posh.

Powershell ISE is a free app to help you develop code in Powershell. AKA Posh.

Or open a text file and save the following code:

$k= New-Object -com "Wscript.Shell"
$a=1
$b=2
$c="Meow moew"
Start-Sleep -seconds 5
$k.sendkeys("$c")

Save as a .ps1 file.

Hit play, or double click the file to execute.

It will take 5 seconds, then your computer will type Meow Meow.

If you kick off any automated security alerts, work with your IT department to unlock this ability. You are building a new app and that means it can do positive or negative things. Which is a risk from a commercial/enterprise business computing perspective. Also, data privacy, your manager, smart people in your company will likely want to know what the code looks like and will seek to read the code before they let it play in their environment. Or you’re at home and no big deal.

Line by line tutorial below:

Line 1
$k= New-Object -com "Wscript.Shell"

New-Object Creates an instance of a Microsoft .NET Framework or COM object.

New-Object Opens the ability to send a keystroke within PowerShell.

We call this with $k moving forward.

Like in math class, you used X to represent a value or Y to represent a value.

This makes our code easier to write and read.

$k.sendkeys, later in the script, is now easier.

-comobject or -com for short is a special ability.

The -Comobject Specifies the programmatic identifier (ProgID) of the COM object. Luckily you don’t need to understand what this means.

Line 3,4,5
$a=1
$b=2
$c="Meow moew"

Like in math class, you have X representing a value and Y representing a value.

We will use these extra variables later in the tutorial.

Today, $a and $b represent a tiny lesson, which is.. you can leave unused code.

And if you remove it, your code will be faster.

Line 7
Start-Sleep -seconds 5

Ever tried living without sleeping? Writing UI automation is the same. You need breaks, waits, pauses, etc.

In powershell, it’s called Start-Sleep -seconds X…

Optimize your code by updating the following.

$k= New-Object -com "Wscript.Shell"
$a=1
$b=5
$c="Meow moew"
Start-Sleep -seconds $b
$k.sendkeys("$c")

Swapping values visually in paint using powershell

Paint helps quickly explain where these two swap. Helping us apply another X value to a number.

explaining basic stuff with screenshots in powershell

Here’s how we use $b later in the lesson. Glad you’re not skipping ahead! Powershell isn’t half bad, right?

Line 8
$k.sendkeys("$c")

Finally, let’s make my computer say meow meow.

You’re passing the $c = “Meow meow” to whatever text field available.

explaining UI automation by automating text into my twitter handle @itylergarrett

Meow meow on twitter.. Great. 0 likes.

Interested in more?

How to Loop your Code | PowerShell Looping

Cool, I’m sure I will write about how to do this in advanced versions but without the basics, I doubt anyone will understand where this will go!

Best,

Tyler Garrett

A Very Quick Introduction to PowerShell

Powershell is a windows only computer programming language and it reads pretty easy on the eyes. You might be wondering why I’m saying it reads easy.

Some programming languages to do not read easy.

Some programming languages do read easy..

Powershell is one of those easy languages.

It’s free and comes on every windows computer.

It also usually comes with PowerShell ISE.

I’m going to add on to this more today and want a link to easily copy and paste. Come back later if you want to learn more.

How to Loop your Code | PowerShell Looping

Make Your Computer Type For You in PowerShell

 

Using PYAUTOGUI with Colaboratory – Not possible Today

Using PYAUTOGUI with Colaboratory – Not possible Today

Using Pyautogui with Colaboratory is not currently possible because the code isn’t running with an active display, rather it’s more of a web based place to run python… In this blog I show you the basics and you can follow along on my Colaboratory.

Being super new at python, and just discovering Colaboratory, I figured, might as well test this new python library Pyautogui, in Colaboratory, not really thinking about the logic of the code.

GUI automation should be accomplished on a local machine. Colaboratory is a nice place to add code related to pyautogui, and explain pyautogui, but it will not be a place for GUI automation as it does not have a relevant display, being that a server is running the code, you don’t have a relevant display… Literally none what-so-ever..

A screenshot of colaboratory when trying pyautogui

PyAutoGUI in Colaboratory to show what’s happening when you try pyautogui.

It was an interesting find and wasn’t surprised to see others are trying but no details on how it works in Colaboratory.

How I learned about pyautogui not working in colaboratory…

So, While automating boring stuff – I found a library called pyautogui.

Installing pyautogui is helpful if you’re looking to automate with python on your personal computer.

Which makes sense because a web based version of python isn’t going to drive your computer? Maybe in the future but the idea here is the process is happening in Colaboratory.

Colaboratory is an online colaboration tool that lets you write code, add files, and document python or other related topics. Mostly Python…

Pyautogui is developed to help people automate on their personal computer, taking advantage of your display, taking over operating system, mouse, keyboard… and moving the mouse to different directions, etc…

Want to see how Colaboratory treats Pyautogui today? I built out a bit of pyautogui and even explain why Pyautogui will not work with Colaboratory.

Follow along here.

List Comprehensions – Learning Python List Comprehensions w/ a non-developer

List Comprehensions – Learning Python List Comprehensions w/ a non-developer

Building a list is a very specific building block in learning code, being a data analyst, or whatever data driven role you find yourself sitting in.

Python List comprehensions provide a concise way to create lists. Common applications are to make new lists where each element is the result of some operations applied to each member of another sequence or iterable, or to create a subsequence of those elements that satisfy a certain condition. (from python)

What is list comprehensions? i for i

List comprehensions is the name of a way to create lists. A more technical rationale would be that list comprehensions provide a more concise way to create lists.

Before we begin, let’s discuss two simple methods to printing our list comprehensions.

print [i for i in range(3)]

Or we can use a letter, word, or letters+words. We will only use this method below.

x = [i for i in range(3)]
print x

Below, I will explain how to use list comprehensions, what list comprehensions is all about, and various ways to use list comprehensions when utilizing Python! Woohoo, getting excited, I can tell. (I can’t, I’m weird)

What is the goal with list comprehensions?

It is proposed to allow conditional construction of list literals using for and if clauses. It’s like you haven’t heard of either of these today, if so, go check out python’s website on list comprehensions. If this does make sense, you may also be interested to know the proposed solution not only lets you generate conditional lists with for and if, they would nest the same way for loops and if statements nest now.

About the tutorials below.
If you’re not entirely sure what any of the above text means, woohoo. You’re on the right track, you’re on the right blog, and if you do know the techie words above, but not entirely sure what it means in code, or in python… Check it out…

Tutorial 1, making a simple list of data in python using List Comprehensions

There are two different ways to make a list of numbers in python.

Take a look at List Comprehension and another more complicated method.

Assuming you have a basic python install and you’re able to do the 2+2 to get 4 in python.

Easy method to make a simple list in python.

x = [i for i in range(10)]
print x

#Output
## >>>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Complex method to make a simple list in python.

x2 = []
for x3 in range(10):
x2.append(x3)
print x2

#Output
## >>>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Both X and X2 generate the same output!

We will focus on the Easy method known as “List comprehension”

Notice we are using a different letter in the list comprehension code below.
When learning python, a lot of example code has “words” which can be changed to letters. Like below, I’m using a “y”… Later in this tutorial or lesson… I’m going to keep changing the “y”, which is the results of the list comprehension in python below!

y = [i for i in range(11)]
print y

You may be thinking, okay, we are increasing the numbers each time, and changing the letter in the beginning. That’s true, it’s a nice little pyramid if you run every bit of code together, which is pretty cool to know… You might be copy pasting different pieces of the code, and in this particular chunk of code, you can run the entire set of code, and not need to worry about anything! It will give you a results of our list comprehension code, which is clearly marked as “print” “firstletter”… easy enough to keep up with.. here’s a curve ball, I changed i to meow, and that works too.

z = [meow for meow in range(12)]
print z

This list comprehension code below has more than a letter, similar to the complex list generation code above, we used x2 (example 2), and similarly, we are not using a letter to describe the results of the list comprehension. For the new programmers -> Light bulb moment? You can name the “X”, “Y”, “Z” anything you damn please… If you’re following here, you should now see a pattern, and easy pattern to generate simple lists with a range of #’s. Also, you might be seeing a little bit of math. How exciting! You’re doing math, in python!

tyler = [i for i in range(14-1)]
print tyler

In the list comprehension below, I’m simply demonstrating addition… On the range() portion of the code.

tyler2 = [DOG for DOG in range(12+2)]
print tyler2

More math, yes division, multiplication, subtraction and addition work in python, pretty well too..

I tested, it’s accurate.

tyler3 = [i for i in range(14/2+7+1)]
print tyler3

#All results should look like:

#[0, 1, 2]
#[0, 1, 2]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
#[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14]

The next few tutorials on list comprehensions will be right up your alley, if you understand the techie mumbo jumbo this will be a good refresh and a hilarious chunk of code you can likely help optimize, and I will gladly add anyone in the tutorial blog posts – and link to whatever website, github profile, etc, and help you rank better. As a novice at all things python, I’m excited to get to know you more as you take the journey I once took. I’m excited to get to know people who think this is total trash too. I need that kind of feedback. I’m learning every day, coding is hard, and I only know what I know, and that means if someone could show me all the ways the code works, I will master the code, otherwise I’m MR. Trial and error. so longest story short, you’re here to learn, me too, so let’s get started by learning everything there is to know about list comprehensions.

python list comprehensions is as necessary as eating this shaved ice desert

Python list comprehensions is as necessary as eating this shaved ice desert.

List comprehensions are powerful but poorly explained by the current top two ranking websites. That’s because they are…

  1. the company website – very smart stuff
  2. some random blog with affiliate links and viruses, popup ads..

I’m excited to show you a proper list comprehensions tutorial, without a single pop up, google ad, or affiliate link.

Pythonforbeginners sold their blog off for marginal return. Popup ads in 2018…

Making Lists in Python – List Comprehensions

Some may call this an “i for i” + “python” on google!

Why is Tyler Garrett rebuilding the wiki on List comprehensions?

The current content when googling i for i python or list comprehensions, is currently plundered with garbage water.

Automate generating a list of values using python 2.X
List comprehensions 101…

If you are new, eager to learn quickly, want to learn without having to code, need lots of examples… Looking for a lot of sample code, that tests a lot of different variations of list comprehensions, or maybe… You looked online, didn’t find anything decent, a little upset trying to learn python, need a better guide… Maybe it’s just me.

Cool, that’s why I write, to replace the TRASH WATER blogs online. No monetizing, no click ads, just solutions.