fxpio / composer-asset-plugin

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

Installing scoped NPM packages #266

Closed ischenko closed 7 years ago

ischenko commented 7 years ago

Good day!

Is it possible to install scoped NPM packages somehow (e.g. @angular/core)?

If the package name specified like "npm-asset/@angular/core" asset manager cannot find the package but if it is specified like "npm-asset/@angular%2fcore" then manager finds the package and downloads its metadata. But after that on the resolving dependencies step I'm getting next error:

Problem 1

  • The requested package npm-asset/@angular%2fcore could not be found, it looks like its name is invalid, "@%" is not allowed in package names.

I would like to install these packages without hacks if it is possible :)

christiaangoossens commented 7 years ago

This issue makes using Angular 2 impossible. Could you add support for scoped NPM packages, so we can update to Angular 2?

francoispluchino commented 7 years ago

Added by 042cb0079cffb2e29fd7c46c42d19513a341a4de.

ischenko commented 7 years ago

@francoispluchino I still cannot install scoped NPM packages, I'm getting:

The requested package npm-asset/@angular/core could not be found, it looks like its name is invalid, "@" is not allowed in package names.

Or am I missing something? Thanks!

Plugin version 1.3.0, Composer version 1.4.1

francoispluchino commented 7 years ago

@ischenko Read the doc Work with the NPM scopes.

For your example, your dependency must be: npm-asset/angular--core.

ischenko commented 7 years ago

@francoispluchino still cannot install it: The requested package npm-asset/angular--core could not be found in any version, there may be a typo in the package name.

I've tried exact version number, wildcard, dev-master and also tried to clear cache.

francoispluchino commented 7 years ago

There is a bug when searching for the package in the NPM Registry when the package is directly added to composer.json. I fix it right away.

ischenko commented 7 years ago

@francoispluchino thank you!