How to remove a Yeoman generator

后端 未结 4 1782
臣服心动
臣服心动 2021-02-03 17:48

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?

相关标签:
4条回答
  • 2021-02-03 18:25

    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]
    0 讨论(0)
  • 2021-02-03 18:38

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

    npm uninstall -g generator-[nameOfGenerator]

    0 讨论(0)
  • 2021-02-03 18:42

    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

    0 讨论(0)
  • 2021-02-03 18:42

    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.

    0 讨论(0)
提交回复
热议问题