Skip to content
This repository has been archived by the owner on Jun 23, 2018. It is now read-only.

Error: Cannot find module 'coffee-script' error when building with cake #56

Closed
sudo-ben opened this issue Nov 17, 2011 · 5 comments
Closed

Comments

@sudo-ben
Copy link

CoffeeScript version 1.1.3

node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'coffee-script'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Module.require (module.js:357:17)
at require (module.js:368:17)
at Object. (/home/ben/OSS/jsrepl/Cakefile:9:12)
at Object. (/home/ben/OSS/jsrepl/Cakefile:290:4)
at Module._compile (module.js:432:26)
at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:66:25)
at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/cake.js:48:18)
at Object. (/usr/local/lib/node_modules/coffee-script/bin/cake:7:38)

@spikebrehm
Copy link

I get the same:

$ cake

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Cannot find module 'coffee-script'
    at Function._resolveFilename (module.js:334:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:357:17)
    at require (module.js:368:17)
    at Object.<anonymous> (/Users/spike/code/backbone-atlas/Cakefile:6:12)
    at Object.<anonymous> (/Users/spike/code/backbone-atlas/Cakefile:43:4)
    at Module._compile (module.js:432:26)
    at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:68:25)
    at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/cake.js:48:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/coffee-script/bin/cake:7:38)
$ node --version
v0.6.6
$ npm list -g
...
/usr/local/lib
├── coffee-script@1.2.0 

@ivorbosloper
Copy link

Same here: (mac, updating node & npm to latest version did not work)

$ cake build

node.js:134
        throw e; // process.nextTick error, or 'error' event on first tick
        ^
Error: Cannot find module 'coffee-script'
    at Function._resolveFilename (module.js:322:11)
    at Function._load (module.js:267:25)
    at require (module.js:351:19)
    at Object.<anonymous> (/Users/ivor/dev/js/chosen/Cakefile:10:18)
    at Object.<anonymous> (/Users/ivor/dev/js/chosen/Cakefile:196:4)
    at Module._compile (module.js:407:26)
    at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:68:25)
    at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/cake.js:48:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/coffee-script/bin/cake:7:38)
    at Module._compile (module.js:407:26)

@ivorbosloper
Copy link

Finally found a fix, set your NODE_PATH env variable correctly. See http://forums.pragprog.com/forums/169/topics/9021

$ export NODE_PATH=/usr/local/lib/node:/usr/local/lib/node_modules

I followed instructions elsewhere to only include /usr/local/lib/node, but the /usr/local/lib/node_modules is required as well.

@spikebrehm
Copy link

Yep! that did it. Thanks!

@armw4
Copy link

armw4 commented Dec 10, 2014

👍

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

5 participants