duojs / duo

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

Specifying path to file inside Github repo broken? #427

Closed nataliethistime closed 9 years ago

nataliethistime commented 9 years ago

I'm not sure I'm using this correctly, but this is what I'm getting:

// 1.js
var uid = require('matthewmueller/uid');
console.log(uid(10));
// 2.js
var uid = require('matthewmueller/uid:index.js');
console.log(uid(10));

Running duo 1.js && node build/1.js works as expected and logs an id. However duo 2.js && node build/2.js does not work, producing the following output (debug mode turned on):

C:\Users\Nathan\Desktop\test>duo 2.js && node build/2.js
  duo-package could not read auth details from ~/.netrc +0ms
     building : 2.js  duo running: 2.js +277ms
        using : component_compat  duo using plugin: component_compat +0ms
        using : stoj  duo using plugin: stoj +0ms
  duo parsing: 2.js +15ms
  duo 2.js: has not been modified. skip parsing +0ms
        built : 2.js  duo ran: 2.js +0ms

C:\Users\Nathan\Desktop\test\build\2.js:20
    throw new Error('cannot find module "' + name + '"');
          ^
Error: cannot find module "matthewmueller/uid:index.js"
    at require (C:\Users\Nathan\Desktop\test\build\2.js:20:11)
    at C:\Users\Nathan\Desktop\test\build\2.js:40:14
    at Object.<anonymous> (C:\Users\Nathan\Desktop\test\build\2.js:86:11)
    at call (C:\Users\Nathan\Desktop\test\build\2.js:38:8)
    at require (C:\Users\Nathan\Desktop\test\build\2.js:19:31)
    at outer (C:\Users\Nathan\Desktop\test\build\2.js:57:7)
    at Object.<anonymous> (C:\Users\Nathan\Desktop\test\build\2.js:84:3)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)

Node version: 0.10.35 npm version: 1.4.28 OS: Windows 8.1

I hope that's enough information to figure out what's going on. :)

johntron commented 9 years ago

Worked for me on: duo 0.9.2 node 0.10.26 npm 1.4.3 OS X Mavericks

Have you tried addressing the ~/.netrc issue? duo-package could not read auth details from ~/.netrc

Also, it says 2.js wasn't modified - what are the contents of build/2.js? Is it what you expect, or is stuff missing? Maybe there's a problem detecting modifications.

stephenmathieson commented 9 years ago

also working fine for me:

stephenmathieson at MBP in ~/repos/github.com/duojs/bugs/427
$ duo --version
0.9.2
stephenmathieson at MBP in ~/repos/github.com/duojs/bugs/427
$ node --version
v0.11.14
stephenmathieson at MBP in ~/repos/github.com/duojs/bugs/427
$ vim 2.js
stephenmathieson at MBP in ~/repos/github.com/duojs/bugs/427
$ cat 2.js 
// 2.js
var uid = require('matthewmueller/uid:index.js');
console.log(uid(10));
stephenmathieson at MBP in ~/repos/github.com/duojs/bugs/427
$ duo 2.js --stdout > build.js

     building : 2.js
        using : component_compat
        using : stoj
    installed : matthewmueller-uid@0.0.2
        built : 2.js

stephenmathieson at MBP in ~/repos/github.com/duojs/bugs/427
$ node build.js 
93svlaet9o
nataliethistime commented 9 years ago

@johntron I'll look at getting Auth set up, I didn't think it was necessary.

2.js wasn't modified, for whatever reason that was the second time I ran it.

Update: I setup the ~/.netrc file and I got the same cannot find module on 2.js

nataliethistime commented 9 years ago

Doesn't seem like anybody knows what's up with my setup/configuration or whatever. I'm using Browserify in my project, so this is not a problem anymore. Closing..