evanmoran / oj

Unified web templating for the people. Thirsty people.
MIT License
444 stars 7 forks source link

oj crashes without coffee-script #2

Closed hudon closed 11 years ago

hudon commented 11 years ago

Running npm install oj followed by ./node-modules/.bin/oj throws an uncaught exception:

module.js:340
    throw err;
          ^
Error: Cannot find module 'coffee-script'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/hudon/Dropbox/MyCode/web/jsjsjs/node_modules/oj/generated/server.js:13:12)
    at Object.<anonymous> (/home/hudon/Dropbox/MyCode/web/jsjsjs/node_modules/oj/generated/server.js:1197:4)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
evanmoran commented 11 years ago

Great to have you looking at oj! You need to install it globally instead. Try running:

npm install -g oj

Let me know if that works for you!

hudon commented 11 years ago

That didn't work either (same error)

evanmoran commented 11 years ago

Fixed! The issue was coffee-script was a dev dependency instead of a full dependency. Let me know if that resolves it for you.

Also, I should be clear that you don't need to use CoffeeScript, unless you want to =). The command line tool understands files of type .oj (javascript) or .ojc (coffeescript), to make static site building simpler.

walesmd commented 11 years ago

If CoffeeScript is optional, shouldn't it be removed completely from package.json? OJ's end-user would include CoffeeScript within their own application's dev dependencies.

evanmoran commented 11 years ago

Sorry to not be clear. CoffeeScript is optional to use but not optional for the OJ commandline tool. The end user doesn't need to install anything but the packages they use oj-twitter-button for example and the oj commandline will do the rest.

walesmd commented 11 years ago

Ah, okay, that makes sense. Thanks for the speedy clarification though. I haven't had the time just yet to experiment with it myself but it definitely looks like a fun project!

hudon commented 11 years ago

@evanmoran yep, that fixed it. cheers

evanmoran commented 11 years ago

Glad you all are talking a look! Feel free to reach out to me if something isn't clear or you have feature ideas.