Skip to content
This repository was archived by the owner on Aug 2, 2018. It is now read-only.

"example/module" seems not work correctly #387

Open
ali322 opened this issue Nov 12, 2014 · 16 comments
Open

"example/module" seems not work correctly #387

ali322 opened this issue Nov 12, 2014 · 16 comments

Comments

@ali322
Copy link

ali322 commented Nov 12, 2014

when i build node index.js,the output file "build.js" seems not include the required file,if run the build.js,
error message got "can not find module",any ideas?

if change the main.js line 2

var bind = require('ianstormtaylor/[email protected]:index.js');

to

var bind = require('ianstormtaylor/[email protected]');

everything will ok
is there any problem about "require with paths" ?

@dominicbarnes
Copy link
Contributor

Hmmm, it works as expected for me. (using both of your examples) Are you sure you have the most up-to-date code from the repo? Could you include what version of node you are using?

@ali322
Copy link
Author

ali322 commented Nov 13, 2014

my node version is 0.10.32,the example still not work as expect when "require with paths",-__-

@dominicbarnes
Copy link
Contributor

Could you post a gist of your build.js?

@ali322
Copy link
Author

ali322 commented Nov 13, 2014

here is another example: test.js

var bind = require('ianstormtaylor/[email protected]:/index.js');
console.log(bind, '!!!');

then i run with command

duo test.js>build.js

the built file "build.js" not work when node build.js,got error "cannot find module bla bla"

@dominicbarnes
Copy link
Contributor

What version of duo do you have installed?

@ali322
Copy link
Author

ali322 commented Nov 13, 2014

here is the build.js
https://gist.github.com/ali322/e44bddde5dcd584172c9

@ali322
Copy link
Author

ali322 commented Nov 13, 2014

duo version is 0.8.10,node version is 0.10.32
ps:my os is win7 x64

@dominicbarnes
Copy link
Contributor

Hmmm, yeah I cannot reproduce this at all. I'm on Mac OSX, how about you?

@ali322
Copy link
Author

ali322 commented Nov 13, 2014

my os is win7 x64,is there any problem?

@ali322
Copy link
Author

ali322 commented Nov 13, 2014

finally i found the point:
change line 1

var bind = require('ianstormtaylor/[email protected]:/index.js');

to

var bind = require('ianstormtaylor/[email protected]:index.js');

just use the relative path to require,it will be ok

@ali322
Copy link
Author

ali322 commented Nov 13, 2014

its weird,the "build.js" not built correctly on Win7 x64,but build success on Ubuntu,the same source file
"test.js"

var bind = require('ianstormtaylor/[email protected]:/index.js');
console.log(bind, '!!!');

@dominicbarnes
Copy link
Contributor

The example does not use the leading /. (ie: use index.js instead of /index.js)

@ali322
Copy link
Author

ali322 commented Nov 13, 2014

yes, "example/module" is built success on Ubuntu,but still got "cannot find module" error on Win7 x64

@dominicbarnes
Copy link
Contributor

Bummer, I don't have access to a Windows machine atm, so I won't be able to test this further. Sorry about that :(

Does anyone else with Win7 (or any Windows machine for that matter) see this same behavior?

@ali322
Copy link
Author

ali322 commented Nov 13, 2014

anyway,THX for ur answer

@michaelnagy
Copy link

I'm seeing this behavior here, it's a win 10 x64 machine. When trying to require module simplefocus/FlowType.JS.

I tried with all combinations of urls you can imagine, like: simplefocus/FlowType.JS:/flowtype.js; simplefocus/FlowType.JS@master:flowtype.js; simplefocus/FlowType.JS@master:/flowtype.js; simplefocus/[email protected]:flowtype.js; simplefocus/[email protected]:/flowtype.js

this is my require file: https://gist.github.com/michaelnagy/11fea88b41add32f98d7e4eff53ebad4

The module are still not loading. console.log throws the message: "cannot find module"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants