duojs / duo

A next-generation package manager for the front-end
3.42k stars 118 forks source link

Some packages have sub dependencies that make duo think its another github repository #459

Closed jruddell closed 9 years ago

jruddell commented 9 years ago

I just started creating a project using duo. Really loving it so far. I noticed that some repositories have sub dependencies that causes duo to think they are github repositories and fail when looking for them. I'm using React, and the react-router from Rackt. In the react-router they have requires like this:

var invariant = require("react/lib/invariant");

which makes duo look for a github repo.

this is the error message

[
    Error: Command failed: /bin/sh -c git ls-remote --tags --heads https://github.com/lib/invariant
    remote: Repository not found.
    fatal: repository 'https://github.com/lib/invariant/' not found
]

Please let me know if you need more information about this and I'll try and provide more details, Thanks!

schnie commented 9 years ago

Hey @johnruddell, having the same issue. Were you able to get around this somehow?

dominicbarnes commented 9 years ago

This syntax is not supported in duo, you should use the following syntax instead:

var invariant = require('react:lib/invariant');

The : basically tells duo to look for that path within the react repo.

schnie commented 9 years ago

Ah, thanks!

On Tue, Jun 2, 2015 at 2:03 PM, Dominic Barnes notifications@github.com wrote:

This syntax is not supported in duo, you should use the following syntax instead:

var invariant = require('react:lib/invariant');

The : basically tells duo to look for that path within the react repo.

— Reply to this email directly or view it on GitHub https://github.com/duojs/duo/issues/459#issuecomment-108035164.

dominicbarnes commented 9 years ago

I'll go ahead and close this ticket, please re-open if that doesn't solve your issue.

jruddell commented 8 years ago

@dominicbarnes that doesn't solve the issue. I dropped react-router because it broke the whole system. the issue with your solution is that require is not my code. var invariant = require("react/lib/invariant"); is a part of the react-router package. Duo needs to ignore node module packages when compiling