Sample Video Frame

Created by Zed A. Shaw Updated 2024-07-27 03:36:01

04: Setup for Windows

The installation and setup instructions were created in Jul 2022 and are updated whenever there's a change that makes them incorrect. If you find that these instructions are wrong then please comment on this lesson and I'll fix whatever you find. Be sure to triple check that you are actually finding something wrong and aren't simply making a mistake.

Create Three Accounts

You are most likely used to running windows as Administrator, or a user with full administrator rights. I'm going to recommend that you stop doing this and instead configure 3 accounts:

  1. One account named "administrator" that has administrator rights.
  2. Your normal personal account, which you should already own, but reconfigure it to have no administrator rights.
  3. A new "programmer" account that is nice and clean and is used when you're going through this book to keep your work life separate from your personal life. It should also not have administrator rights.

The purpose of this setup is partially security, and partially to keep you from destroying your computer. If you have a separate administrator account then any time you need to do something that requires administrator rights, Windows will prompt you for the administrator password. You'll still be able to run all of your software, but it will improve your personal and programmer account's security.

The security advantage of a separate administrator account comes from malicious virus software and hackers. Because you run as an administrator there is nothing stopping malicious software from fully owning and hacking your computer. When you run as a non-administrator account most of this software is stopped by Windows, making it safer. Some estimates are that 80-90% of windows attacks are stopped by this simple change.

The second purpose is to keep your programming activities from totally destroying your computer. When you run as administrator there are actions you can take which can cause damage, but if you run as a normal user then you can really only destroy your own account's files. This is why a non-personal work account is better since, if you do something stupid, then you only lose your code and not your entire life's work.

Required Software

I've created a set of installer scripts for windows that will automate installing most of the tools you need do any kind of programming you want. To install JavaScript, first open a PowerShell windows and run these two commands:

irm https://learncodethehardway.com/setup/base.ps1 -outfile base.ps1
powershell -executionpolicy bypass .\base.ps1

This will install many base tools you'll need like Windows Terminal, Geany, and a basic C/C++ compiler for extensions.

Once that runs close this PowerShell and start a new one. In this new PowerShell run these two commands:

irm https://learncodethehardway.com/setup/nodejs.ps1 -outfile nodejs.ps1
powershell -executionpolicy bypass .\nodejs.ps1

This will install Node.js and you're done. You can now close this PowerShell and use the Windows Start menu to start Windows Terminal by typing "terminal" into the search.

NOTE There are other scripts that install other languages, so if you need installs for Rust, Zig, Crystal, C, C++, and many others check out the git project page for more. All of these installers use winget and choco to do the installs, so you can use those tools directly instead of my scripts if you want.

Confirming Your Installation

To confirm you've installed everything correctly attempt the following tasks:

  1. Use the Windows Start menu to start Windows Terminal.
  2. In this terminal type: node --version
  3. You should see a version similar to 18.12.1 which could be slightly higher or lower.
  4. In the same Terminal type: git --version
  5. You should see a version like 2.19 with the word "windows" in it, but closer to 2.37.1 is preferred.
  6. Hit your Windows key to start the taskbar menu search, and type: chrome
  7. Chrome should start and work. Do the same thing with firefox so you can make sure they all run.
  8. Hit the windows key again and start Visual Studio Code. Usually just typing "vs" will find it.
  9. Finally, use the windows key to run WSL by typing: ubuntu
  10. You can exit ubuntu type typing: exit

If you can do all of these tasks then everything should be installed and ready to use. If not then confirm you actually installed the software correctly. The video for this lesson shows how to install the software on Windows and perform all of these checks. It might have clues for your own installation.

Previous Lesson Next Lesson

Register for Learn JavaScript the Hard Way

Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.