Saturday, 20 June 2020

Setting Environment for Angular

  source: different websites n following these work for me

Must have : user account with sudo privileges

you must familiar with these two commands refresh our local package

sudo apt-get update
sudo apt-get upgrade
  
sudo apt-get update
Then you probably want to make sure that your system is up to date:
sudo apt-get upgrade
It will list the packages wants to install, tell you how much space it needs for the download, and then get on with it when you tell it to. When you want to install some new software

Trying toinstall angular oops...

Mayank:~$ npm install -g @angular/cli
Command 'npm' not found, but can be installed with:

First need to install npm packages...

Angular, the Angular CLI, and Angular apps depend on features and functionality provided by libraries that are available as npm packages

Mayank:~$ npm - v
Command 'npm' not found, but can be installed with:
Mayank:~$ sudo apt install npm

Mayank:~$ node -v
Command 'node' not found, but can be installed with:
Mayank:~$ sudo apt install nodejs
Mayank:~$ node -v
Output
v8.10.0
Mayank:~$ npm - v
Output
5.6.0
 
The Angular CLI requires a minimum Node.js version of either v10.13 or v12.0.

Please update your Node.js version or visit https://nodejs.org/ for additional instructions. 

To update Node.js to 12 & NPM on Ubuntu 19.04

Mayank:~$ sudo curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
Mayank:~$ sudo apt-get install -y nodejs  
Mayank:~$ npm install -g @angular/cli
Mayank:~$ ng new my-angular-app 
 
Mayank:/opt/angularws$  ng new my-angular-app 
? Would you like to add Angular routing? Yes
? Which stylesheet format would you like to use? CSS
CREATE my-angular-app/README.md (1029 bytes)
CREATE my-angular-app/.editorconfig (274 bytes)
CREATE my-angular-app/.gitignore (631 bytes)
CREATE my-angular-app/angular.json (3630 bytes)
CREATE my-angular-app/package.json (1256 bytes)
CREATE my-angular-app/tsconfig.json (489 bytes)
CREATE my-angular-app/tslint.json (3125 bytes)
CREATE my-angular-app/browserslist (429 bytes)
CREATE my-angular-app/karma.conf.js (1026 bytes)
CREATE my-angular-app/tsconfig.app.json (210 bytes)
CREATE my-angular-app/tsconfig.spec.json (270 bytes)
CREATE my-angular-app/src/favicon.ico (948 bytes)
CREATE my-angular-app/src/index.html (298 bytes)
CREATE my-angular-app/src/main.ts (372 bytes)
CREATE my-angular-app/src/polyfills.ts (2835 bytes)
CREATE my-angular-app/src/styles.css (80 bytes)
CREATE my-angular-app/src/test.ts (753 bytes)
CREATE my-angular-app/src/assets/.gitkeep (0 bytes)
CREATE my-angular-app/src/environments/environment.prod.ts (51 bytes)
CREATE my-angular-app/src/environments/environment.ts (662 bytes)
CREATE my-angular-app/src/app/app-routing.module.ts (246 bytes)
CREATE my-angular-app/src/app/app.module.ts (393 bytes)
CREATE my-angular-app/src/app/app.component.css (0 bytes)
CREATE my-angular-app/src/app/app.component.html (25757 bytes)
CREATE my-angular-app/src/app/app.component.spec.ts (1083 bytes)
CREATE my-angular-app/src/app/app.component.ts (218 bytes)
CREATE my-angular-app/e2e/protractor.conf.js (808 bytes)
CREATE my-angular-app/e2e/tsconfig.json (214 bytes)
CREATE my-angular-app/e2e/src/app.e2e-spec.ts (647 bytes)
CREATE my-angular-app/e2e/src/app.po.ts (301 bytes)
✔ Packages installed successfully.

Mayank:/opt/angularws$ cd my-angular-app
Mayank:/opt/angularws/my-angular-app$ ng serve --open