How to remove a Yeoman generator
Asked Answered
V

4

46

I accidentally installed a generator that I don't want.
I can't find any method to remove it.
What should I do to accomplish this?

Volumetric answered 23/7, 2013 at 8:2 Comment(0)
P
94

Generators are just normal npm modules, so you can remove it with

npm uninstall -g generator-[nameOfGenerator]

Parted answered 23/7, 2013 at 9:7 Comment(2)
How do you remove a generator with spaces in the name? I tried enclosing it in quotes, but it says it's not installed.Aeolotropic
Looks like you can replace the spaces with hyphens. E.g. npm uninstall -g generator-app-with-spacesAeolotropic
B
6

npm uninstall -g [generator-name] might not fix the UNMET DEPENDENCY. If you won't mind to reinstall the affected modules:

  1. cd to your npm directory (e.g. /usr/local/bin/node_modules)
  2. rm -rf [generator-name]
  3. npm cache clean
  4. npm install -g [generator-name]
Blackball answered 16/3, 2015 at 21:3 Comment(0)
C
5

Search for generators with

npm list -g --depth=0 | grep 'generator'

Remove generator with

npm uninstall -g [generator-name] 

NOTE: Don't include '@[version] ' that follows the generator name

Coriss answered 26/2, 2016 at 5:24 Comment(0)
L
1

I wanted to add something for posterity:

If you get an number of errors of class 'peerDependencies' for yeoman's generators, updating yo alone will not cut it - you need to remove all generators that throw the error and then reinstall whatever module lead to the trouble.

Unfortunately, as far as I ahve chekced, regex is not supported by npm.

Locklear answered 6/6, 2014 at 14:40 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.