Composer downloading ridiculous amounts of NPM packages

Hi

Had this problem for a while now, but it seems that when I run Composer update, it downloads a truly staggering amount of NPM packages, including all the tags, versions etc of packages I don’t even use directly. Is this is expected behavior of composer in this case? And more importantly how can I speed it up?




Reading package.json of npm-asset/lodash._root (3.1.4)

Reading C:/Users/AppData/Local/Composer/repo/github.com/lodash/lodash/npm-cf4b24e71874b5f99a53e8db1 from cache

Importing tag 3.1.4 (3.1.4.0)

Reading package.json of npm-asset/lodash._root (3.1.3)

Reading C:/Users/AppData/Local/Composer/repo/github.com/lodash/lodash/npm-f9b7856dcf66bae3dd021ecd5 from cache

Importing tag 3.1.3 (3.1.3.0)

Reading package.json of npm-asset/lodash._root (3.1.2)

Reading C:/Users/AppData/Local/Composer/repo/github.com/lodash/lodash/npm-5ce4a06026ceba380faab1938 from cache

Importing tag 3.1.2 (3.1.2.0)

Reading package.json of npm-asset/lodash._root (3.1.1)

Reading C:/Users/AppData/Local/Composer/repo/github.com/lodash/lodash/npm-971ec86b096bee82e66b97768 from cache

Importing tag 3.1.1 (3.1.1.0)

Reading package.json of npm-asset/lodash._root (3.1.0)



It also downloads the packages every single time. It just completed and I ran composer update again, hoping it would just fly through caches and it doesn’t.

Hi Jonny,

Take a look at the following sections of the guide:

Guide > Installing Yii > Installing Assets (http://www.yiiframework.com/doc-2.0/guide-start-installation.html#installing-assets)

Guide > Assets > Bower and NPM Assets installation (http://www.yiiframework.com/doc-2.0/guide-structure-assets.html#bower-npm-assets)

What’s slowing down “composer update” is “composer asset plugin”. We can totally get rid of it, but a decent alternative is “asset-packagist-org” IMO.

I have this running globally already. composer global require "fxp/composer-asset-plugin:^1.4.1"

Is there a better solution than this?

That’s the cause of the problem.

Consider using asset-packagist.

Ohhh. Gotcha! Thanks man!

I have the same problem with composer. If i use the --verbose option i have alot alot and alot of these:




...

Importing tag v1.6.0 (1.6.0.0)

Reading bower.json of bower-asset/bootstrap-select (1.9.1)

Importing tag 1.9.1 (1.9.1.0)

Reading bower.json of bower-asset/bootstrap-select (1.9.0)

Importing tag 1.9.0 (1.9.0.0)

Reading bower.json of bower-asset/bootstrap-select (1.5.4)

Importing tag 1.5.4 (1.5.4.0)

Reading bower.json of bower-asset/bootstrap-select (1.5.2)

Importing tag 1.5.2 (1.5.2.0)

Reading bower.json of bower-asset/bootstrap-select (1.5.1)

Importing tag 1.5.1 (1.5.1.0)

Reading bower.json of bower-asset/bootstrap-select (1.5.0)

Importing tag 1.5.0 (1.5.0.0)

Reading bower.json of bower-asset/bootstrap-select (1.4.3)

Importing tag 1.4.3 (1.4.3.0)

Reading bower.json of bower-asset/bootstrap-select (1.4.2)

Importing tag 1.4.2 (1.4.2.0)

Reading bower.json of bower-asset/bootstrap-select (1.4.1)

Importing tag 1.4.1 (1.4.1.0)

Reading bower.json of bower-asset/bootstrap-select (1.4.0)

Importing tag 1.4.0 (1.4.0.0)

Reading bower.json of bower-asset/bootstrap-select (1.3.7)

Importing tag 1.3.7 (1.3.7.0)

Reading bower.json of bower-asset/bootstrap-select (1.3.6)

Importing tag 1.3.6 (1.3.6.0)

Reading bower.json of bower-asset/bootstrap-select (1.3.5)

Importing tag 1.3.5 (1.3.5.0)

Reading bower.json of bower-asset/bootstrap-select (1.3.4)

Importing tag 1.3.4 (1.3.4.0)

Reading bower.json of bower-asset/bootstrap-select (1.3.3)

Importing tag 1.3.3 (1.3.3.0)

Reading bower.json of bower-asset/bootstrap-select (1.3.1)

Importing tag 1.3.1 (1.3.1.0)

Reading bower.json of bower-asset/bootstrap-select (1.3.0)

Importing tag 1.3.0 (1.3.0.0)

Reading bower.json of bower-asset/bootstrap-select (1.2.0)

Importing tag 1.2.0 (1.2.0.0)

Reading bower.json of bower-asset/bootstrap-select (1.0.0)

...



and it take about 30 minutes to update.

Can you suggest me a good solution?

Thank’s

I followed the advice above: https://www.yiiframework.com/doc/guide/2.0/en/structure-assets#bower-npm-assets. Worked well for me