02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

Setting up a terminal for Windows users

Setting Up a Terminal for Windows Users

In this tutorial, we will guide you through setting up a terminal for Windows users, which is essential for working effectively with Node.js and NPM. Windows users often face unique challenges when setting up a command line environment, but with the right tools and configurations, you can create a setup that feels just as powerful as a Unix-based system. This tutorial was created in 2016, and we have included important updates to reflect modern best practices.

Step 1: Choosing Your Terminal

The default command prompt in Windows is limited in functionality, which can make it cumbersome to work with for Node.js development. To create a better experience, we recommend using a more versatile terminal such as Windows Terminal, PowerShell, or Git Bash.

Critical Update (2024): Since 2019, Microsoft has introduced Windows Terminal, which has become the go-to terminal for developers working on Windows. It features multiple tabs, customizable profiles, and integration with PowerShell and WSL (Windows Subsystem for Linux).

Installing Windows Terminal

  1. Install from Microsoft Store: The easiest way to get Windows Terminal is through the Microsoft Store. Simply search for "Windows Terminal" and click install.
  2. Configuration: Once installed, you can customize the appearance, fonts, and key bindings by editing the settings.json file in Windows Terminal.

If you prefer a simpler terminal, Git Bash is another popular option, especially if you're already using Git for version control.

Step 2: Installing Node.js and NPM

With the terminal set up, the next step is to install Node.js and NPM. These tools are essential for running JavaScript outside the browser and managing the dependencies of your projects.

  1. Download the Installer: Visit Node.js official website and download the recommended LTS (Long Term Support) version for stability.
  2. Run the Installer: Follow the prompts to install Node.js and NPM. Make sure to check the box that says "Add to PATH" during the installation process.
  3. Verify the Installation: Open your terminal and type:
    node -v
    npm -v
    
    These commands will display the versions of Node.js and NPM, confirming that the installation was successful.

Critical Update (2024): As of now, the recommended way to manage multiple versions of Node.js is to use Node Version Manager (nvm) for Windows. This allows you to easily switch between different versions of Node.js, which is very useful for managing different projects.

Step 3: Configuring the Terminal for Node.js Development

Once Node.js and NPM are installed, it's helpful to configure your terminal for efficient use:

  • Add Aliases: You can add aliases to your terminal configuration file to make frequently used commands shorter. For example, adding an alias for npm start can save time.

    • For Git Bash, you can add aliases in the .bashrc file.
    • For PowerShell, you can add them in the $PROFILE script.
  • Install Useful Packages: Use NPM to install globally useful packages such as npm-check-updates to keep your dependencies current, and nodemon to automatically restart your server during development.

Example: Adding Aliases in Git Bash

To add an alias in Git Bash, open your .bashrc file using:

nano ~/.bashrc

Add the following line to create an alias for starting your application:

alias startapp="npm start"

Save and close the file, then run:

source ~/.bashrc

Now you can use startapp in your terminal instead of typing npm start every time.

Conclusion

Setting up a terminal environment for Windows is a crucial first step in becoming comfortable with Node.js development. By choosing the right terminal, installing Node.js and NPM, and configuring the environment to your liking, you can significantly improve your development workflow.

Remember to use Windows Terminal for a modern, efficient experience, and consider using tools like nvm to manage multiple Node.js versions. These small optimizations will make your journey into JavaScript and full stack development much smoother.

Video Transcript

00:00Welcome to Essential Full Stack Development.
00:02The course that is gonna completely upgrade your career,
00:06full stack development is the hottest, most rewarding,
00:10and currently the most financially rewarding skill you wanna
00:13have under your belt.
00:15Now, before we get into
00:16what we're gonna cover in this course,
00:18I just wanna say my name is Ben Valla
00:20and this is a packed publishing production.
00:23With that said, this course is
00:26for you in most probability if you're watching this video,
00:29but under the assumption
00:31that you already know JavaScript, that's the only thing.
00:33The only prerequisite you must have
00:35before taking this course is you need to know JavaScript.
00:38You don't need to know anything else.
00:40We're gonna cover all the other foundations
00:42and fundamentals
00:43to get you into full stack development, right?
00:46So that's it, that's the prerequisites.
00:49So what are we gonna cover in this title?
00:51This title is revolutionary
00:53because it's really gonna cover all the foundations
00:56that are critical for you to be able to know, to be able
00:59to call yourself a full stack developer.
01:01So what does that include?
01:03So first of all, we're gonna, in the first chapter,
01:05set things up with basically getting node js
01:08and NPM up and running.
01:10In the second chapter, we're gonna go deep into the world
01:12of NPM and understand what package managers are
01:16and what specifically could you do with NPM, which is the
01:20critical technology that with it,
01:23you're building everything in full stack.
01:26Next, we're gonna dive deep into the world of NO js,
01:28where we'll get you familiar enough to understand
01:31how no jfs works,
01:33so you'll feel comfortable when you're developing
01:35in this environment.
01:37We're gonna also go deeper
01:39by taking a look at the express JS framework work,
01:42which is in a layer that sits on top of node js
01:45that makes things easier when it comes to anything
01:48that relates to building and working on a server.
01:52Last but not least, the most critical skill
01:54that you wanna wrap things up to be able to say that,
01:57you know, all the critical skills in full stack development
02:01is getting you familiar with MongoDB,
02:03or more accurately the technology behind it,
02:06which is no SQL.
02:07We're gonna understand what node no SQL is
02:10and literally learn the foundations to enable you
02:13to build your own databases.
02:15So by the end of this course, you're going to be a developer
02:19that is working on, on your server.
02:21You're gonna be building server, side code,
02:23client side code,
02:25and oso integrating into it, no SQL.
02:29So what are we co we,
02:30what are we gonna cover in this first chapter?
02:32So this first chapter is really all about
02:34setup and then the setup.
02:35We're gonna go through the configurations for Windows,
02:38the configurations for desktops in general, configurations
02:41for a server itself, namely a Linux server,
02:44and OTO specifically how to change the different versions
02:48of NPM and no gs, which are quite different than
02:51how it's done on a desktop.
02:54With that said, let's jump right into our first lecture.
02:56And in the first lecture we're gonna be focused
02:58on our Windows users.
03:00So if you are running on a Mac,
03:02you could stop this video already now
03:04and go on to the next video.
03:05But if you are a Windows user,
03:07what we're gonna do in this lecture is we're gonna help you
03:10make your operating system work more similarly
03:13to the way things work on a Linux and IO X, um, on a Mac,
03:18because all of the rest
03:20of the videos are gonna be focused on those users
03:22because the production files usually sit on a Linux,
03:26which their language is comparable
03:28and very similar to the way we work on uh, Mac.
03:31So with that said, for our Windows users in this lecture,
03:34we're gonna go ahead and set up a terminal,
03:36which will mimic the terminal that is available on a Mac
03:40and on a Linux operating system, making the,
03:43our Windows users have a similar setting
03:46to the remainder chapter.
03:47So let's jump right in into it.
03:49Windows users, let's see how we set things up to get
03:53things working the way that we're gonna be working
03:56with from the next chapter and onwards.
03:59Before we could start installing
04:01and working with Node js, we need to make sure
04:04that you have access to terminal.
04:07If you're working on Mac, you already have access
04:09to terminal, it's an application that runs on Mac Os.
04:13If you're running on any Linux device,
04:16you're probably familiar with the way you go
04:18to your Linux prompt, which will work the same way.
04:21Now when you're working on contrera on Windows It,
04:25you're going to discover that you don't have access
04:28to the same Linux commands as we have,
04:31and we'll be working with within this course
04:33and within most lectures and documentation on no js.
04:38So to join us, make sure that if you're running on Windows,
04:41you install, um, CYG win.
04:44I can't pronounce it. There's other applications
04:47that do the same thing,
04:48but what they do, it's a wrapper
04:49that mimics the behaviors on Linux.
04:52So go ahead and based on if you have, um,
04:55the link is gonna be in the description to this video.
04:58Um, make sure to install
05:00or update, see, well basically install the 32 bit version
05:04or the 62 64 bit version depending on your
05:07version of Windows.
05:09I'm gonna go ahead and install the 32 bit version
05:14and I'm gonna run it
05:21And once installation will complete, just follow the prompts
05:24and go ahead and go through the process of the installation.
05:29I'm gonna keep everything in its default
05:31and just click next, next, next
05:33until we get it downloaded and installed.
05:36Now once you have Sgu installed, um,
05:40and I'm gonna, it's a little bit outta my screen right now,
05:42but I'm gonna just go ahead
05:44and keep everything the way it is.
05:46I'm not gonna select any package and I'm gonna click on next
05:50and I'm gonna click on next and I'm gonna just go ahead
05:53and install whatever the defaults have been.
05:57So once in installation completes, uh,
05:59we're gonna set up the desktop, add it to the start
06:02or I'm gonna click your un finish.
06:04And once I'm done with this now,
06:06because I set everything up to be in the default,
06:09if you look at your prompt, you'll see that we
06:12on your desktop, you should have the CGU terminal.
06:16Now if I go ahead and double click on it,
06:18I'm gonna be entered into this terminal Now to make sure
06:22that everything is working is well.
06:27Basically, anytime that I actually mention and say terminal
06:30or say, go onto your terminal
06:32or you see me working in this in a prompt, make sure
06:35that you open the sequin terminal
06:37because we're gonna refer to it to the remainder
06:39of the course as terminal.
06:43In this lecture, we went ahead
06:45and saw how to set up our windows to have a terminal using
06:49seig swig, whatever it's called in the next lecture,
06:52we're gonna be operating system Ag stick
06:55as we go back into my Mac.
06:58And on the Mac itself, we're gonna go ahead
07:00and install no JS and NPM,
07:02but the actions that we're gonna be doing are gonna be the
07:04same as they're done on Windows.
07:07So we'll see in the next lecture when we set our NO JS
07:10and NPM Up.

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!