customize

You are here

Wunderkraut Sweden Blog: Adding a external JavaScript library to composer

Error message

  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.
  • You must enable the PECL memcached or memcache extension to use memcache.inc.

Some module require that you download external Javascript-libraries, and in drupal 8 that should be done in Composer. 

The module Masonry require the JavaScript library with the same name. So we need to include the package in composer.json, like:
 

"repositories":[
{
"type":"composer",
"url":"https://packages.drupal.org/8"
},
{
"type": "package",
"package": {
"name": "desandro/masonry",
"version": "master",
"type": "drupal-library",
"dist": {
"url": "https://unpkg.com/masonry-layout@4/dist/masonry.pkgd.min.js",
"type": "file"
}
}
},

And in the require part that is:

"require":{
...
"desandro/masonry":"master",
  ...
},

And then we need to add libraries in extra part of we do not have that:

"extra":{
...
"web/libraries/{$name}":[
"type:drupal-library… Read More

Source: 
https://digitalist.se/adding-external-javascript-library-composer