How do you uninstall all your bower packages?

前端 未结 8 1494
礼貌的吻别
礼貌的吻别 2021-01-30 06:09

Sometimes it\'s useful to rebuild an entire site and force bower to reinstall new versions of all the packages in bower.json.

However, there doesn\'t seem to be any way

8条回答
  •  抹茶落季
    2021-01-30 06:45

    Adapting Jumar Polanco's answer to use it in Powershell, it is possible to programmatically uninstall bower components in the following way:

    In the Powershell interface, navigate to the location where bower.json and the bower_components folder is located. Usually is the root app folder.

    Then you can run:

    foreach($package in ls bower_components){bower uninstall $package}

    Depending on what the packages dependencies are, it may be required to pay extra attention to the process, as some prompts which require extra input (Y/n) to continue the process may arise (such as dependency conflicts).

提交回复
热议问题