fxpio / composer-asset-plugin

NPM/Bower Dependency Manager for Composer
MIT License
893 stars 156 forks source link

Problems installing NPM-assets #321

Closed jeabakker closed 6 years ago

jeabakker commented 6 years ago

since a few days i get errors when trying to update/install npm-asset dependencies

It's trying to update to npm-asset/moment v2.22.1

  - Removing npm-asset/moment (2.22.0)

  [InvalidArgumentException]
  Unknown downloader type: npm-signature. Available types: git, svn, fossil, hg, perforce, zip, r
  ar, tar, gzip, xz, phar, file, path.

I don't know if this is the correct place to report this, if not i'm sorry.

composer --version
Composer version 1.6.4 2018-04-13 12:04:24

and

fxp/composer-asset-plugin v1.4.2 NPM/Bower Dependency Manager for Composer
holtkamp commented 6 years ago

Also got some issues since a few days / since composer 1.6.4: it seems a specific package is removed without any sign. After a composer update no "removals" were reported but the composer.lock file is changed and a package is removed. Reported this in a separate issue, not sure it is related to this issue: https://github.com/fxpio/composer-asset-plugin/issues/322

Zaporozhec7 commented 6 years ago

I have same issue, with same package "npm-asset/moment" of version 2.21.0

hypeJunction commented 6 years ago

Having this issue as well now with npm-asset/formdata-polyfill For some reason it's trying to remove it first, then I get the exception

rob006 commented 6 years ago

The reason: https://blog.npmjs.org/post/172999548390/new-pgp-machinery

I described workaround at Stack Overflow, but it will be a pain if you have multiple npm packages broken by this.

@SilverFire @hiqsol This affects also asset-packagist - just check dist URL of last release of https://asset-packagist.org/package/npm-asset/moment

Zaporozhec7 commented 6 years ago

I have created pull request with fix for this issue, but it fail test, since my fix disallow other dist types than supported by Composer, but in test data used dist type "type" (https://github.com/fxpio/composer-asset-plugin/blob/master/Tests/Converter/NpmPackageConverterTest.php#L192).

I think filter out all unknown by Composer types is right solution, since this can help to avoid new issues like this if next time npm will add another one new field to dist information

twisted1919 commented 6 years ago

Any updates on this ? This simply left our apps broken...

sicutdeux commented 6 years ago

Bump here with npm-asset/load-google-maps-api (1.2.1)

sicutdeux commented 6 years ago

editing the composer.json file and removing the dependency in the require section, then using "composer require" it does work, but that's not a solution really.

SDKiller commented 6 years ago

@sicutdeux

Another workaround - it worked for me (compared with @rob006 described - you need not locate release tarball):

    "config": {
        ...
        "fxp-asset": {
             ...
            "repositories": [
                {
                    "name": "npm-asset/html5sortable",
                    "type": "npm-vcs",
                    "url": "git@github.com:lukasoppermann/html5sortable.git"
                }

Note that you add package to repositories in fxp-asset entry in config, not to repositories in composer.json root.

jeabakker commented 6 years ago

Still no permanent solution (after 1 month)?? @francoispluchino

nimer- commented 6 years ago

Yeah - it is surprising. A lot of workarounds, 1 PR that solves it, but we have no real permanent solution. That's a bummer to say the least.

francoispluchino commented 6 years ago

@jeabakker @nimer- The PR #323 still has errors in the tests, that's why it is not merged. But you can contribute by proposing a valid PR. A help is always appreciated.

twisted1919 commented 6 years ago

@francoispluchino

he PR #323 still has errors in the tests, that's why it is not merged. But you can contribute by proposing a valid PR. A help is always appreciated.

This sounds easy in theory, right? But think a bit, we are developers doing other things and we have no experience to work on your plugin, getting involved would mean maybe hours to only learn it's internals.

If you have problem finding the time, please don't throw it on your user base, instead, set a donation page, let us pay for your time and fix the issue if possible. This is how things work, i would gladly contribute to see this issue solved.

Just my two cents.

francoispluchino commented 6 years ago

@twisted1919 I don't blame the users of my plugin, I just remind that it is not necessary to complain that it doesn't progress and that it is always possible to contribute to go faster. There is a nuance. I understand that it's frustrating because it happens to me when I use OSS components. Personally, when there is a bug, even if I'm only a simple user, I take the time to learn the logic to try to propose a PR fixing the bug if this problem blocks my project, or I wait without complaint if I cannot do it. Apart from this little detail, I already indicated in this comment (in connection with this one) that this plugin would not evolve anymore, and that it would be maintained by the contributions of the community. However, it is true that it is not indicated on the Readme of the repository (but now added with b8f99831d4cc9fdb7ebf53204dfcbf443586d94f).

Also, thank you for your proposal to create a donation page, but this library is not large enough for that. Moreover, a lot of problem cannot be solved for NPM, owing to the difference between Composer and NPM (Bower has more similarity with Composer) and the obligation to use Nodejs more and more for the proper functioning of the assets, with for example, the use of Webpack, Babel, Typescript, Scss, etc... As a result, I worked on a 2.0 version of this plugin, but there is so much difference that it is another project. For more information, you can read the FAQ of Foxy, the next major version of Composer Asset Plugin, to understand the reasons for this change (this comment for more details), and what is the difference between Foxy and Fxp Composer Asset Plugin.

All this to say that I like to share my work, and that I very much appreciate when it be used. I always try to find some free time to maintain my different repositories, even if I do not use them anymore (which is very difficult lately). Regarding this plugin, the future of this tool is in Foxy, but I continue to maintain CAP by merging the PRs of the contributors, because this plugin is still used by some Frameworks either directly or through the Asset-Packagist, but this plugin will no longer receive new features.

Thank you everybody for your understanding.

@hypeJunction has just proposed the PR #324 fixing the exception Unknown downloader type: npm-signature. Does it also fix this issue?

twisted1919 commented 6 years ago

@francoispluchino - thank you for the explanation, i had no idea about all this, i came here because i am a Yii 2 user and that relies heavily on this plugin. Thank you for all the work you have done so far, i personally appreciate it a lot, especially now that i have more insights.

jeabakker commented 6 years ago

v1.4.3 works for me, no more exceptions ;)