fxpio / composer-asset-plugin

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

lodash-amd installs 3.5.3 for ~3.5.0, but npm doesn't see this version #260

Closed nazar-pc closed 7 years ago

nazar-pc commented 7 years ago

It looks like version installed by fxp/composer-asset-plugin is just copied from GitHub (the same contents as here), however, NPM only knows following versions (no 3.5.3):

npm ERR! notarget No compatible version found: lodash-amd@3.5.3
npm ERR! notarget Valid install targets:
npm ERR! notarget 4.16.4, 4.16.3, 4.16.2, 4.16.1, 4.16.0, 4.15.0, 4.14.2, 4.14.1, 4.14.0, 4.13.1, 4.13.0, 4.12.0, 4.11.2, 4.11.1, 4.11.0, 4.10.0, 4.9.0, 4.8.2, 4.8.0, 4.7.0, 4.6.1, 4.6.0, 4.5.1, 4.5.0, 4.4.0, 4.3.0, 4.2.1, 4.2.0, 4.1.0, 4.0.1, 4.0.0, 3.10.2, 3.10.1, 3.10.0, 3.9.3, 3.9.2, 3.9.0, 3.8.0, 3.7.0, 3.6.0, 3.5.0, 3.4.0, 3.3.1, 3.3.0, 3.2.0, 3.1.0, 3.0.1, 3.0.0, 2.4.1, 2.4.0, 2.3.0, 2.2.1, 2.2.0, 2.1.0, 2.0.0

Moreover, installing 3.5.0 using NPM results in very different contents of the lodash-amd directory:

$ cat package.json              
{
  "_args": [
    [
      {
        "raw": "lodash-amd@3.5",
        "scope": null,
        "escapedName": "lodash-amd",
        "name": "lodash-amd",
        "rawSpec": "3.5",
        "spec": ">=3.5.0 <3.6.0",
        "type": "range"
      },
      "/media/Data/tmp"
    ]
  ],
  "_from": "lodash-amd@>=3.5.0 <3.6.0",
  "_id": "lodash-amd@3.5.0",
...
$ ls                            
compat/  LICENSE.txt  main.js  modern/  package.json  README.md
nazar-pc commented 7 years ago

lodash-amd in my scenario is a dependency of npm-asset/scribe-plugin-sanitizer ^0.1 which I'm trying to install. However, when I require it explicitly:

... requires npm-asset/lodash-amd 3.5.3 -> no matching package found
nazar-pc commented 7 years ago

When added npm-asset/lodash-amd 3.5.0 dependency in addition to npm-asset/scribe-plugin-sanitizer ^0.1 it finally installed correct version.

francoispluchino commented 7 years ago
$ composer require npm-asset/lodash-amd:3.5.0

This command works. On the other hand, the v3.5.3 is not registered in NPM, and the Github tags are formatted with -npm-packages, it's for this reason that you cannot install this version.

nazar-pc commented 7 years ago

Yes, it works when you install package directly. But try to install npm-asset/scribe-plugin-sanitizer:^0.1.

nazar-pc commented 7 years ago

Another example - for npm-asset/scribe-plugin-inline-styles-to-elements ^0.1 I'm getting source from 0.1.1 tag (which is the same as bower install scribe-plugin-inline-styles-to-elements#^0.1), but NPM only has 0.1.0 version with completely different source.

In this case it feels like this plugin sometimes installs Bower packages (or suitable Git tags) even when NPM package is required.

francoispluchino commented 7 years ago

Fixed by 1600e622457b41bdd95e2c266f0102b7b095f440.