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:
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.
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.
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.
Simple solution here.
Try:
sudo apt purge ng-common ng-latin
And then, install angular with sudo
:
sudo npm install -g @angular/cli
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With