How to uninstall/upgrade Angular CLI?

RohanArihant picture RohanArihant · Sep 19, 2016 · Viewed 462.5k times · Source

When I try to create a new project with Angular CLI, with:

ng n app

I get this error:

fs.js:640 return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode); ^ TypeError: path must be a string or Buffer at TypeError (native)

How can I upgrade or uninstall Angular CLI?

Answer

Santosh Pillai picture Santosh Pillai · Sep 21, 2016

Using following commands to uninstall :

npm uninstall -g @angular/cli
npm cache clean --force

To verify: ng --version /* You will get the error message, then u have uninstalled */

Using following commands to re-install :

npm install -g @angular/cli

Notes : - Using --force for clean all the caches - On Windows run this using administrator - On Mac use sudo ($ sudo <command>)

  • If you are using npm>5 you may need to use cache verify instead. ($ npm cache verify)