The Node.js Async module to the rescue!

Unlike all inclusive IDE (Integrated Development Environment) development, full stack development can be a bit of a challenge when it comes to installing the right tools and components on your machine. In this post I will attempt to get you up and running with a new machine environment running Windows. First off you need a code editor, so go ahead and install Sublime or VSCode or whatever you like. Here we go…

1.Install visual studio code (https://code.visualstudio.com/)

2. Install GitHub for windows by doing the following: Go to a GitHub project (could be your own, or some other one) and select to clone the project via “Clone or download”. When you click the button to do so, select to “Open in desktop”. You are then redirected to an install page and click “Download Github Desktop”. Make sure it is for Windows. Now complete that install.

githubclone

3. Configure the GitHub desktop. You should set it up to know your GitHub account. After that step, click the settings gear in the upper left and select “Options…”. In there, set the “Default Shell” to be “Git Bash”. Click Save. You also now have Git installed on your machine.

4. Download Node.js from https://nodejs.org/en/. Select the LTS version being shown, not the Current. This also installs npm for you.

5. Open GitHub desktop for windows open. Open your browser and go back to the GitHub repo page and click “Clone or download” again. This time it will do something different. When you click the button, select to “Open in desktop”. You will see a popup and select “Open GitHub”. Select the folder or just keep it where it suggests and complete. After that downloads, right click on the project from the left pane and select “Open in Git Shell”. From this prompt you can type “code .” to start visual studio code. You can type “npm install” to to the installation build of the project.

At this point you may be all done and could run and “npm install” and run such as “node myproj.js”.

There are however some npm downloads in projects that require a more complicated build process such as compiling C++ code, so there needs to be the necessary tools installed for that to happen. There is something called node-gyp that is used as the compiler. This requires Python to be installed on your machine and even some Visual Studio build tools. Here are the rest of the steps to go through:

6. Go to https://www.python.org/ and Click Downloads and then for windows click Download Python. You must select a 2.7 version version. I just took the latest one. Run the install and make sure on the bottom of one of the install pages you see where you can select to have Python added to your path. Select to have that on local hard drive.

python

pythonoption

7. Download Visual Studio 2015 Community Edition, choose custom install. Select the Visual C++ branch (you can uncheck XP support). Also check Windows SDKs. (See my image). Go to the windows environment variables settings (in System, Advanced settings). Add GYP_MSVS_VERSION=2015 to the global variables in advanced system settings. BTW, the download can take hours.

one

two

systemvars

Now, you can call me superstitious, but I like to reboot my machine at this time. It just seems to set everything right to go forward from here. Things like your changes to system variables don’t actually take affect until after you log out and back in anyway.

Now you can try and do the npm install again and see it work. Open Git Hub desktop and right click on your repo to open the git bash window and you are good to go. The nice thing now is that if you want to make changes to a project hosted on GitHub you you can manage all of that, either completely from Visual Studio Code, or in combination with GitHub Desktop for Windows.

Let’s say you want to make a change to a branch first and then do a Pull Request and then merge that back to the master branch. You simply create the branch in the UI of GitHub Desktop. Then make your code changes. Back in GitHub Desktop, do the commit. Then click to Publish it. Then go to Github in the browser and you can create a Pull Request for that and do the merging. I know this last description was very brief, so perhaps I should do a separate blog on it.

About Bushman

Living a purposeful life.
This entry was posted in Uncategorized and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s