Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require failing for some node.js modules #1485

Closed
balupton opened this issue Jul 4, 2011 · 1 comment
Closed

Require failing for some node.js modules #1485

balupton opened this issue Jul 4, 2011 · 1 comment

Comments

@balupton
Copy link

balupton commented Jul 4, 2011

Originally I thought this was a npm issue, but the NPM author believes it is a coffee-script issue.

Source: https://github.com/isaacs/npm/issues/1106

@balupton says:

Hey Isaac,

So I've published my module buildr which uses another one of my modules called cson, but when I try to run buildr I get Error: Cannot find module 'cson'. Here is the full log. This really has me scratching my head... :/

$ node -v
v0.4.9
$ npm -v
1.0.15
$ npm -g install buildr
/usr/local/bin/buildr -> /usr/local/lib/node_modules/buildr/bin/buildr.coffee
buildr@0.4.4 /usr/local/lib/node_modules/buildr
├── bal-util@0.4.0
├── cson@0.1.1
├── coffee-script@1.1.1
└── less@1.1.2
$ buildr
Error: Cannot find module 'cson'
at Function._resolveFilename (module.js:317:11)
at Function._load (module.js:262:25)
at require (module.js:346:19)
at Object. (/usr/local/lib/node_modules/buildr/bin/buildr.coffee:3:10)
at Object. (/usr/local/lib/node_modules/buildr/bin/buildr.coffee:18:4)
at Module._compile (module.js:402:26)
at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script.js:62:19)
at /usr/local/lib/node_modules/coffee-script/lib/command.js:120:29
at /usr/local/lib/node_modules/coffee-script/lib/command.js:90:26
at [object Object]. (fs.js:107:5)

@isaacs says:

This is a coffee-script bug. Looks like it doesn't use node's module lookup when you use the "coffee" command.

@jashkenas?

npm explore -g buildr
node
require("coffee-script"); require("cson")
{ parseFile: [Function], parse: [Function], stringify: [Function] }

$ coffee
coffee> require("cson")
Error: Cannot find module 'cson'
at Function._resolveFilename (module.js:317:11)
at Function._load (module.js:262:25)
at require (module.js:346:19)
at repl:2:5
at Object.eval (/usr/local/lib/node_modules/coffee-script/lib/coffee-script.js:89:15)
at Interface. (/usr/local/lib/node_modules/coffee-script/lib/repl.js:39:28)
at Interface.emit (events.js:64:17)
at Interface._onLine (readline.js:153:10)
at Interface._line (readline.js:408:8)
at Interface._ttyWrite (readline.js:585:14)

@michaelficarra
Copy link
Collaborator

I believe this is a duplicate of #1035, module.paths in the REPL.

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

No branches or pull requests

2 participants