Ember-CLI: How to remove an addon?


#1

I was currently updating my project from ember-cli 0.1.6 to 0.1.9 and an addon which I added before but don’t need anymore was throwing an error. So, I thought “oh well, how hard could it be to remove an addon?” and tried first ember uninstall:npm "module-name" - but this command doesn’t exist. OK, so I moved on and did npm uninstall --save-dev "module-name" which successfully removed the addon from my node_modules folder, but when I run ember serve in my project it won’t start because it now tries to find the (unused) addon which is not referenced anywhere in my project.

Does anyone know how to successfully remove a previously installed addon from an ember-cli project?

P.S.: I once spoke to @erik_bryn (back at emberfest2014 in barcelona) about how I think that the build process is somewhat “magical” and “cumbersome” and why I think a developer should know the internals - this is really a point where I wish I stayed with ember-app-kit and its grunt build system where the dev is really the “master” of the source code and not “locked out” when it comes down to build your own project…


#2

I don’t think there is one and it would certainly be useful.

What I’ve done is look at the repository and undo the changes (most cases just package.json).


#3

thanks for your answer @xBlack - I ended up doing a rm -rf node_modules bower_components tmp dist and reinstalled the npm and bower libraries. still, this is really odd and I don’t have a good feeling when I’m not in full charge of my application :persevere:


#4

@xBlack: reverting your pacakge.json does not clean your node_modules and what not, so technically the package is still installed.


#5
  • Remove the addon from package.json
  • Run: npm prune

#6

FWIW, I made a short compilation of ways to uninstall an add-on: http://emberigniter.com/uninstall-remove-ember-add-on/


#7

Hey everyone! The articles at emberigniter.com are great! They also get updated to the latest Ember version everytime and is continously being ‘enhanced’. Invaluable resource!


#8

I know this is an old thread but I thought it was also worth mentioning for the benefit of anyone else reading that yarn does an automatic prune when you type yarn install.