Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ng serve or ng new does not work

I am getting this message on the terminal, saying that I'm not able to run the app. After enter ng serve to run the Angular application. Please see attached image:

error screenshot

like image 459
Pravin Kadam Avatar asked Aug 23 '17 04:08

Pravin Kadam


People also ask

Why is NG serve taking so long?

This is mostly because of bulky source map files. When you do ng serve , Angular serves the app from memory instead of the dist folder (the file system). This means the entire code (along with map files) will be loaded into the system's memory and this is the main reason why your system or IDE getting slow.

What is the difference between ng serve and Ng serve?

Difference between ng serve and ng buildThe ng serve command is intentionally for fast, local and iterative developments and also for builds, watches and serves the application from a local CLI development server. The ng build command is intentionally for building the apps and deploying the build artifacts.

What is the use of NG new?

ng new also creates the following workspace and starter project files: A new workspace, with a root directory named angular-tour-of-heroes. An initial skeleton application project in the src/app subdirectory. Related configuration files.


1 Answers

Simple solution here.

Try:

sudo apt purge ng-common ng-latin

And then, install angular with sudo:

sudo npm install -g @angular/cli
like image 189
Pixsa Avatar answered Oct 14 '22 20:10

Pixsa