Reputation: 3869
I have installed coffeescript
and node
via nvm
. But I'm getting errors when I require the coffee in Node.js console:
var cs = require('coffee-script/register');
// => Error: Cannot find module 'coffee-script/register'
or
var cs = require('coffee-script');
// => Error: Cannot find module 'coffee-script'
My environment:
node -v
// => v5.0.0
coffee -v
// => CoffeeScript version 1.10.0
npm list -g coffee-script
// => ~/.nvm/versions/node/v5.0.0/lib
// => └── [email protected]
I think this problem is causing other errors like this:
knex --help
// => Failed to load external module coffee-script/register,coffee-script
Upvotes: 1
Views: 1611
Reputation: 1
If someone still looking for legacy application. This one might help, https://www.npmjs.com/package/coffee-register.
Upvotes: 0
Reputation: 36592
The registered module name is coffee
; just do var cs = require('coffee');
Upvotes: 0
Reputation: 13682
I guess you didn't install coffee-script
locally, npm i coffee-script --save
in your project's root folder.
Upvotes: 1