How to install angular-cli to Cloud9
- Update Node.js version to 6.9.0 or higher
- Install Angular CLI
- Configure for running project
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.
- Open new Terminal window.
- 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
- If everything went well, open new Terminal window/tab.
- List what versions of Node are currently installed (probably none).
- Install latest Node.js LTS release.
nvm install v6.11.2
- 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
npm install -g @angular/cli
- Generating and serving an Angular project via a development server
ng new PROJECT-NAME
- Open hosts file
sudo nano /etc/hosts
- Add and save this line
- Start server
ng serve -H <workspace>-<username>.c9users.io