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

Cannot find module issue #23

Closed
zanona opened this issue Feb 26, 2011 · 1 comment
Closed

Cannot find module issue #23

zanona opened this issue Feb 26, 2011 · 1 comment

Comments

@zanona
Copy link

zanona commented Feb 26, 2011

Hello, I am wondering if this is possible or am I doing something wrong?

the following code:

Mustache = require 'mustache'

person =
  name : "john"
  email: "john@domain.com"

template = """
  <p>Hello {{name}}</p>
  <p>your email is: {{email}}</p>
"""

output = Mustache.to_html template, person

console.log output

works fine when using cat test.coffee | coffee -s through terminal, but if running with cmd+b the Run command within textmate it returns:

Error: Cannot find module 'mustache' at Function._resolveFilename (module.js:289:11) at Function._load (module.js:241:25) at require (module.js:317:19) at Object. (.:3:14) at Object. (.:11:4) at Module._compile (module.js:373:26) at Object.run (/usr/local/lib/node/.npm/coffee-script/1.0.1/package/lib/coffee-script.js:55:19) at /usr/local/lib/node/.npm/coffee-script/1.0.1/package/lib/command.js:115:29 at Socket. (/usr/local/lib/node/.npm/coffee-script/1.0.1/package/lib/command.js:149:14) at Socket.emit (events.js:39:17)

Is there any way to use require modules using textmate bundle?
It seems require 'sys' is possible though...

@zanona
Copy link
Author

zanona commented Feb 26, 2011

Nervermind...
As explained on the README I didn't have $NODE_PATH defined inside textmate.
just added to the TM Shell Variables as

NODE_PATH -> /usr/local/lib/node

and now it's working fine :)

sorry I didn't noticed it before posting here

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

No branches or pull requests

1 participant