-2

So I installed Angular and Angular 2 so I had both commands ng and ng2. While I uninstalled Angular (ng) just fine, I was unsure of how to uninstall Angular 2. As I understand in the future all AngularJS 1 and AngularJS 2 will just be known as Angular. So given this I'm simply trying to install the latest version of Angular so the command will simply be ng. And this is why I wish to remove ng2 . Hope this isn't confusing.

Thanks in advance. Yes I did google this to see how to remove it however I didn't find any npm remove commands. I tried several but simply didn't find the correct one.

Dale
  • 1,613
  • 4
  • 22
  • 42
  • "As I understand in the future all AngularJS 1 and AngularJS 2 will just be known as Angular." Nope. "AngularJS" refers to AngularJS 1.x. "Angular" refers to Angular 2, Angular 4, etc.. – Heretic Monkey Apr 20 '17 at 17:10
  • 1
    Also, [`npm uninstall`](https://docs.npmjs.com/cli/uninstall)... – Heretic Monkey Apr 20 '17 at 17:11
  • Possible duplicate of [how to uninstall npm modules in node js?](http://stackoverflow.com/questions/13066532/how-to-uninstall-npm-modules-in-node-js) – Heretic Monkey Apr 20 '17 at 17:11
  • Recommended: http://stackoverflow.com/questions/2791121/what-every-digit-means-in-software-version-1-7-1-0-for-example Althought after 2.x (what is tottally rewritten) is intended give support back in versions those are not needed to be compatible – Sam Apr 20 '17 at 17:18
  • Important is if you have the concept now. Thank you for you assessment – Sam Apr 20 '17 at 18:21
  • I wanted to add some info that could be usefull for you. I suppose you have read about it yet but there is it. Don't say thanks, you are welcome :) peace. – Sam Apr 20 '17 at 19:28

1 Answers1

1

npm just store your packages in the folder node_modules. Search for this folder where you have your node installed. Remove the folder of the package you want to remove. Check your packages.json and ensure you have not references to angular 2 or remove those. run npm clean cache. run npm install. It is the same if you run npm uninstall as @Mike McCaughan says

PD. @Mike McCaughan said true. I feel you are not clear about the concept.

Edit. By manual way u need to remove variables of your path variables in your OS if you have installed something that adds any.

Edit: I was thinking if you was not able to run npm uninstall because u was not doing with -g option. When you install node you are provided with 'Node Package Manager'. And let you use it in your system by adding a path variable to your command shell. In itself, node uses this npm to manage his own dependencies when you specify -g (global) option.

Any place you have a packages.json file if you navigate there and run npm [whatever] it will have effect on this path not global, and will create the node_modules folder to store packages in this same folder. With dependencies you specify in this packages.json.

Unless you specify -g. Then you refer to the packages of your node instance located where you have installed node. The purpose is modular dependencies through NPM. I hope I have made myself understood.

Another option is when you execute npm install with the option --save (-g or not)

Then you will save that package to your packages.json and everytime you run npm install it will be taken into account and installed.

Last is when you specify --save-dev instead

Then you say you only want the package for your development environment. You will find there are different places for dependencies and dev-dependencies in you packages.json

Last edit promised: One thing wrong I said is that it is stored in your root folder where you installed node. It is not. It is instantiated per user of the OS. If you are using windows you will find {user}/AppData/Roaming/npm You will find there all packages you install globally

Sam
  • 1,459
  • 1
  • 18
  • 32
  • That is an all together different concept than the modules as mentioned above. – Dale Apr 20 '17 at 19:58
  • what do you mean? forget the post, just talk about and we remove it after. – Sam Apr 20 '17 at 19:59
  • So everything else applies above except the folder is {user}/AppData/Roaming/npm? – Dale Apr 20 '17 at 20:02
  • Well, you install node with npm. It is instantiated for your user and will be different of another user in your system. So, this path user/appdata... store your user global dependencies and are managed using -g option. But all are different of project dependencies wich are dominated by the packages.json file located in the project folder. And also use npm. when you do npm instal being in a path you look for packages.json and install what it say. If you do -g option you affect your local global instance. used for example to install yeoman, bower... stuff that you want in your system. – Sam Apr 20 '17 at 20:05
  • Angular is a project dependency, you should have a folder for your project dominated by a packages.json what say "angular" as dependency. It is done for being modular. When you run the project on another node server he knows what your project require. Then he can do npm install in your path and that is all. But of course he doesnt need to have angular in his system. You also not. – Sam Apr 20 '17 at 20:09
  • no problem. Do whatever with the post, I am here just for help and learn. I took time also to understand it at all when I have begin with Angular first versions and nodejs – Sam Apr 20 '17 at 20:15
  • Go to system properties in advanced configuration and check environment variables. You will notice as you have diferent paths for your system variables and user variables PATH for npm. There is the global instance I was talking above (-g). Try doing npm install -g yo and install yeoman in your system, for example. – Sam Apr 20 '17 at 20:19