fxpio / composer-asset-plugin

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

fail to add npm-asset/react #261

Closed kiuka closed 7 years ago

kiuka commented 7 years ago

Hello,

I tried to add npm-asset/react dependency, but I got the following error:

C:\Users\user\PhpstormProjects\test>composer require npm-asset/react Using version ^15.3 for npm-asset/react ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your GitHub credentials are required to fetch private repository metadata (https://github.com/babel/babel/tree/master/packages/babel-plugin-syntax-flow) Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+DESKTOP-OC2FD2F+2016-10-25+1507 to retrieve a token. It will be stored in "C:/Users/user/AppData/Roaming/Composer/auth.json" for future use by Composer. Token (hidden): Token stored successfully.

Installation failed, reverting ./composer.json to its original content.

[UnexpectedValueException] Invalid version string "0.8.0-SNAPSHOT"

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--prefer-sta ble] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] []...

My dev environment: Win 10

npm -v 3.10.8

git --version git version 2.10.0.windows.1

composer --version Composer version 1.2.1 2016-09-12 11:27:19

schmunk42 commented 7 years ago

You might try to exclude the version with

"extra": {
  "asset-pattern-skip-version": "(-build|-patch|-SNAPSHOT)",
}
mathielen commented 7 years ago

Unfortunately the problem still persists even with the pattern-skip directive. In my case I use: "npm-asset/angular-ui-bootstrap": "2.4.0"

Which results into:

[UnexpectedValueException] Invalid version string "2.5.0-SNAPSHOT"

on Ubuntu 16.10

npm -v 3.10.10

git --version git version 2.7.4

composer --version Composer version 1.3.1 2017-01-07 18:08:51

francoispluchino commented 7 years ago

@schmunk42 The asset-pattern-skip-version is used after the package conversion. SNAPSHOT isn't converted for the moment.

francoispluchino commented 7 years ago

Fixed by 69fd13c958ea4ea104402fc5ca74b821fb1355c3.