I got a following error when I tried to watch coffee scripts by coffee -o js -cw coffee.
/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:321 throw e; ^
Error: watch Unknown system errno 28 at errnoException (fs.js:636:11) at FSWatcher.start (fs.js:663:11) at Object.watch (fs.js:691:11) at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:287:27 at Object.oncomplete (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:100:11)I have no idea what is going with error.
Then I checked the versions, coffee -v is 1.6.1 and node -v is v0.6.12.
According the official site( ) the latest version is 1.6.3, so I wanted update coffee by npm update -g coffee-script, but this fails also.
npm WARN coffee-script@1.6.1 package.json: bugs['name'] should probably be bugs['url']
npm http GET
npm http 304 How can I update coffee script?
Edit 2013/10/11
In my coffee script directory there is only one file box_wrapper.coffee.
$ -> $("body").children().wrap -> "<div id='#{$(@).attr "id"}_box' class='wrapper'/>"Edit 2013/10/16
I tried to re-install coffee, so I've done like this.
$ sudo npm -g rm coffee
npm WARN Not installed in /usr/local/lib/node_modules coffee
$ coffee -v
CoffeeScript version 1.6.1I can't remove coffee. And I tried also like this.
$ sudo apt-get remove npm
$ npm -v
-bash: /usr/bin/npm: No such file or directory
$ sudo apt-get install npm
$ npm -v
1.1.4
$ sudo npm -g install coffee
# I omit a lot of `GET` parts.
npm http 304
npm ERR! error installing express@3.2.6
npm http 304
npm http 304
npm http 304
npm http 304
npm http 304
npm http 304
npm http 304
npm ERR! error rolling back express@3.2.6 Error: UNKNOWN, unknown error '/usr/local/lib/node_modules/coffee/node_modules/express'
npm ERR! error installing coffee@0.0.1
npm ERR! EEXIST, file already exists '/usr/local/lib/node_modules/coffee/node_modules/mocha/node_modules'
npm ERR! File exists: /usr/local/lib/node_modules/coffee/node_modules/mocha/node_modules
npm ERR! Move it away, and try again.
npm ERR!
npm ERR! System Linux 3.2.0-54-generic-pae
npm ERR! command "node" "/usr/bin/npm" "-g" "install" "coffee"
npm ERR! cwd /home/ironsand
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! path /usr/local/lib/node_modules/coffee/node_modules/mocha/node_modules
npm ERR! fstream_path /usr/local/lib/node_modules/coffee/node_modules/mocha/node_modules/___debug.npm
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EEXIST
npm ERR! message EEXIST, file already exists '/usr/local/lib/node_modules/coffee/node_modules/mocha/node_modules'
npm ERR! errno {}
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:161:23
npm ERR! fstream_stack Object.oncomplete (/usr/lib/nodejs/mkdirp.js:34:53)
npm ERR! EEXIST, file already exists '/usr/local/lib/node_modules/coffee/node_modules/mocha/node_modules'
npm ERR! File exists: /usr/local/lib/node_modules/coffee/node_modules/mocha/node_modules
npm ERR! Move it away, and try again.
npm ERR!
npm ERR! System Linux 3.2.0-54-generic-pae
npm ERR! command "node" "/usr/bin/npm" "-g" "install" "coffee"
npm ERR! cwd /home/ironsand
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! path /usr/local/lib/node_modules/coffee/node_modules/mocha/node_modules
npm ERR! fstream_path /usr/local/lib/node_modules/coffee/node_modules/mocha/node_modules/___debug.npm
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EEXIST
npm ERR! message EEXIST, file already exists '/usr/local/lib/node_modules/coffee/node_modules/mocha/node_modules'
npm ERR! errno {}
npm ERR! fstream_stack /usr/lib/nodejs/fstream/lib/writer.js:161:23
npm ERR! fstream_stack Object.oncomplete (/usr/lib/nodejs/mkdirp.js:34:53)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ironsand/npm-debug.log
npm not okAnd npm-debug.log is a blank file.
2 Answers
The thing is that the npmjs repositories doesn't have the 1.6.3 but the 1.6.1. I will presume here, but the reason of your error is with your code, not CoffeeScript:
} catch (e) { if (e.code !== 'ENOENT') { throw e; } } };The above indicates that if e.code isn't exactly the same as ENOENT then throw the error, which in your case is:
Error: watch Unknown system errno 28 at errnoException (fs.js:636:11) at FSWatcher.start (fs.js:663:11) at Object.watch (fs.js:691:11) at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:287:27 at Object.oncomplete (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:100:11)I would check the file fs.js and/or reverting the last changes you did to your code. CoffeScript is doing just fine, the problem is elsewhere.
For people that might actually update their CoffeScript
If you really want to use the latest CoffeScript, then the method to install it is using:
npm install -g This will install the latest CoffeScript, if you want the 1.6.3 version then you should use:
npm install -g Replace the 1.6.3 with the version of CoffeScript you like.
The error occurs because of old nodejs version.
Ubuntu 12.04, 13.04 default nodejs package is version 0.6.x.
I updated nodejs version to v0.10.20 like this, then the problem is solved.
sudo apt-get update
sudo apt-get install python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejsI followed the instruction from here.
2