So I've done...
npm install -g jquery
and I run coffee in terminal...
then I type in require 'jquery'
And I get an error :/. I've tried variations of the above to no avail.
How can I use jQuery functions in my Coffeescript REPL ?
You installed a jquery module as global module.
If the module identifier passed to require() is not a native module (e.g. http), and does not begin with '/', '../', or './', then Node.js starts at the parent directory of the current module, and adds /node_modules, and attempts to load the module from that location.
If it is not found there, then it moves to the parent directory, and so on, until the root of the file system is reached.
To make global modules available to the Node.js (and CoffeeScript) REPL, it might be useful to also add the /usr/lib/node_modules folder to the $NODE_PATH environment variable. Since the module lookups using node_modules folders are all relative, and based on the real path of the files making the calls to require(), the packages themselves can be anywhere.
npm i coffee-script jqueryand it's work.