Angular 6 has new CLI command ng add <package>
.
How can I remove the package using Angular CLI?
UPDATE
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.
This question is related to
angular
angular-cli
npm uninstal @angular/material
and also clear file custom-theme.scss
With the cli I don't know if it's a remove command but you can remove it from package.json and stop using it in your code.If you reinstall the packages you wilk not have it any more
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.
Sometimes a dependency added with ng add
will add more than one package, typing npm uninstall lib1 lib2
could be error prone and slow, so just remove the not needed libraries from package.json
and run npm i
I think best approach until Angular team add this feature to cli is first create angular (ng new something) in other place and then add what you want to delete. Using git to check witch files are changed or added by angular cli. then you can revert that changes.
Be careful of untracked files from .gitignore
.
As simple as this command says npm uninstall your-package-name
This command will simply remove package without pain from node modules folder as well as from package.json
Source: Stackoverflow.com