(UPDATED and tested for latest Drupal 11)

Installing the required Webform libraries to your Drupal 9, D10, and D11 websites can be such a mess, oftentimes messing around with your composer file and causing errors, and rendering your D9 or D10 website unusable.

The documentation and different options and ways to do this properly can also be daunting as there does not seem to be a standard way to do this.

To easily install the Webform libraries, you may follow the simple steps below. The same had been taken from https://www.drupal.org/docs/contributed-modules/webform/webform-librarie… all options had been tested using composer as recommended. From all these options, below seems the easiest to do and working:

  1. Webform module required, of course! This article assumes you have tried numerous webform-related commands to install the dependencies as well, but couldn’t get it to work.
  2. Check under /admin/reports/status, and you might notice that a long list webform external libraries that may be available but not installed, such as: Algolia Places, Choices, CKEditor: Autogrow, CKEditor: CodeMirror, CKEditor: Fake Objects, jQuery: Chosen, jQuery.Hotkeys, Progress Tracker, and more. We need to address this then. Follow the subsequent steps.
  3. From your command line (yes, you need SSH access and Composer and Drush supported webhosting), run:
    drush webform:libraries:composer

    This will Generate a composer.json necessary for the Webform’s libraries
    This will update your composer file like in the below screenshot

    D9 install and download webform libraries

  4. Create a folder called libraries in your website root, e.g. /public_html/libraries (alongside all the first level directories of your Drupal website is located – core, modules, sites, themes, vendor, etc. )
    webform libraries create libraries folder
  5. From your command line (yes, you need SSH access and Composer and Drush supported webhosting), run:
    drush webform:libraries:download

    This will now download and install all necessary and required libraries of your Webform module in the directory created /libraries.

    drupal 9 webform libraries download 3

  6. That’s it! Optionally, you may run composer update, drush updb, and drush cache:rebuild to ensure all system cache are purged. You may check again under /admin/reports/status for any more requirements needed.