문제

I want to put https://github.com/timrwood/moment into my composer.json for easy maintenance.

It's not an official packagist project (of course, as it's not PHP), but it contains a packages.json for nodejs. Can I use this in my composer.json?

I tried this, but it didn't work:

{
    "repositories": {
        "timrwood/moment": {
           "type": "git",
           "url": "git://github.com/timrwood/moment.git"
        }
    }
}

It throws an error message saying "No valid composer.json was found in any branch or tag of git://github.com/timrwood/moment.git, could not load a package from it."

And it is lacking the version string to define the version I want to use...

Can anyone help here?

Or shouldn't I use composer here at all cause I'm mixing JS and PHP?

도움이 되었습니까?

해결책

Composer only manages composer packages. It does not know how to parse a package.json file. There are different approaches to this problem. Composer may be able to deal with frontend dependencies in the future.

For the time being I'd recommend using a separate dependency manager for your JavaScript dependencies. Either NPM or something like jam or ender.

다른 팁

Check out composer plugin to handle components via bower, nodejs and git repositories: fxpio/composer-asset-plugin.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top