Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove package using Angular CLI?

Angular 6 has new CLI command ng add <package>.

How can I remove the package using Angular CLI?

UPDATE

documentation

ng add will use your package manager to download new dependencies and invoke an installation script (implemented as a schematic) which can update your project with configuration changes, add additional dependencies (e.g. polyfills), or scaffold package-specific initialization code

It is not the same npm install <package>

I was trying to use ng rm but it is not working yet.

like image 581
Dmitry Grinko Avatar asked May 12 '18 13:05

Dmitry Grinko


People also ask

How do I remove a package from Ng?

The Best Answer is. You can use npm uninstall <package-name> will remove it from your package. json file and from node_modules. If you do ng help command, you will see that there is no ng remove/delete supported command.

How uninstall npm global package?

A global package is a package that is installed globally on your machine, so you don't have to reinstall it every you need it. To remove a global package, you need to attach the -g flag to npm uninstall, and then specify the name of the package. The basic syntax for doing this is npm uninstall -g package-name .


2 Answers

You can use npm uninstall <package-name> will remove it from your package.json file and from node_modules.

If you do ng help command, you will see that there is no ng remove/delete supported command. So, basically you cannot revert the ng add behavior yet.

like image 147
Nour Avatar answered Oct 10 '22 04:10

Nour


It's an open issue #900 on GitHub, unfortunately at this point of time it looks that in Angular CLI there's nothing like ng remove/rm/..., only using npm uninstall DEPENDENCY is the current workaround.

like image 44
Daniel Danielecki Avatar answered Oct 10 '22 05:10

Daniel Danielecki