fxpio / composer-asset-plugin

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

Installing NPM dependencies fails #264

Closed mburtscher closed 6 years ago

mburtscher commented 7 years ago

We are already using this plugin for ~20 bower libraries. Now I'm trying to install the NPM library babel-cli:

"require-dev": {
    "npm-asset/babel-cli": "master"
}

Downloading just fails with a GitHub API error (token required). Entering an existing or new token multiple times fails. I always get the same error message:

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-cli)
Head to https://github.com/settings/tokens/new?scopes=repo&description=Composer+on+mburtscher+2016-11-14+1652
to retrieve a token. It will be stored in "/home/users/mburtscher/.composer/auth.json" for future use by Composer.
Token (hidden): 
francoispluchino commented 7 years ago
  1. You must use the requirement style of Composer: dev-master
  2. Reset your Composer config (see the doc)

It should do it normally.

mburtscher commented 7 years ago

I'm afraid it doesn't fix the issue. Tried both dev-master and a version constraint like ^6.0. Resetted my auth.json config and created a new GitHub token – still the same issue.

It works for a very small NPM library but not babel-cli or any other larger lib.

francoispluchino commented 7 years ago

This plugin has been designed to manage web assets, not to replace NPM or Bower, because there are technical limitations to Composer.

For NPM, only flatten dependencies are compatible, because Composer does not know how to handle multiple sub-dependencies. For babel-cli, you must have Nodejs for it work. This plugin isn't a js runtime, but simply a downloader of dependencies.