Blog

How to install angular-cli to Cloud9

How to install angular-cli to Cloud9

Steps:

  1. Update Node.js version to 6.9.0 or higher
  2. Install Angular CLI
  3. Configure for running project

Update Node.js

The reason for using nvm instead of other install types is mainly in how easy it is to have multiple versions of Node.js (if needed) without too much of extra complexity. Sometimes applications might require a certain version of Node.js to work, so having the flexibility of using specific versions can save a lot of time from you.

  1. Open new Terminal window.
  2. Run nvm installer with either curl or wget.
  • curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
  • wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
  1. If everything went well, open new Terminal window/tab.
  2. List what versions of Node are currently installed (probably none).
  • nvm ls
  1. Install latest Node.js LTS release.
  • nvm install v6.11.2
  1. Set a default Node version for nvm (enabling you to actually use it in a new Terminal session windows).
  • nvm alias default v6.11.2

Install Angular CLI

  1. Installation
  • npm install -g @angular/cli
  1. Generating and serving an Angular project via a development server
  • ng new PROJECT-NAME
  • cd PROJECT-NAME

 Configure

  1. Open hosts file
  • sudo nano /etc/hosts
  1. Add and save this line
  • 0.0.0.0 <workspace>-<username>.c9users.io
  1. Start server
  • ng serve -H <workspace>-<username>.c9users.io

Comments (0)

Leave a Comment