Getting started with Angular on Windows 10
Installing Node & NPM
First off, Angular relies upon the Node.js runtime environment to run, as well as the Node Package Manager (NPM) to install Angular itself. Installing Node is simple enough, simply head to Nodejs.org, and click the link for the recommended Windows .msi installer. At the time of writing, the recommended release was v6.11.2 (for Windows 10 x64).
Once Node is installed, I verified the versions of Node and NPM by running
node -v and
in the command line.
With Node/NPM installed, Angular can now be installed by typing
npm install -g @angular/cli in
the command line. This process might take a few minutes.
Creating the first test app
I navigated to a directory I created called ‘angular’, I then ran the command
ng new my-first-app to
generate a new skeleton application in a subdirectory called my-first-app.
To test the generated app, I then changed directory to the application and ran the webserver
ng serve --open:
Running this command should then open the default web browser (Chrome in my case) to the
app’s URL at
http://localhost:4200/. The resulting page is rather unimpressive, but still
a small achievement for someone with no experience of using Angular (or anything like it).
One-hundred and eighty-five megabyte ‘Hello World’?!
After realising my created ‘app’ weighed in at a whopping 185MB (and tens of thousands
of files), I genuinely considered rage-uninstalling Angular, although to be fair, a large
chunk of that is taken up by the
node-modules folder, but still, to someone who comes
excessive just for one web page.