Closed demark closed 12 years ago
Nice catch, I'll look into it.
Should be fixed in 1.2.0t
Okay, iced -I inline
mode bug fixed. But on node
mode still not
iced = require('iced-coffee-script').iced
for i in [0..5]
await setTimeout defer(), 1000
console.log i
Still throws the same err
You sure you're all up-to-date and your paths are set correctly? For me it just worked with 1.2.0t but failed with 1.2.0s
....And sadly there's not a good way to add a regtest here...
You sure you're all up-to-date and your paths are set correctly?
Hmm, i've recently installed ubuntu 10.04 & coffee-script & iced-coffee-script packages installed globally using npm
sudo npm install coffee-script -g
sudo npm install iced-coffee-script -g
What file i should look to check correct paths?
Can you do this for me? iced --print test.coffee
and paste in the result? Here test.coffee
is that little demo script that you have.
Also, what does iced --version
output?
IcedCoffeeScript version 1.2.0t
&&
(function() {
var i, iced, __iced_deferrals, __iced_k, __iced_k_noop, _i, _next, _while,
_this = this;
iced = require('iced-coffee-script').iced;
__iced_k = __iced_k_noop = function() {};
i = 0;
_while = function(__iced_k) {
var _break, _continue;
_break = __iced_k;
_continue = function() {
++i;
return _while(__iced_k);
};
_next = _continue;
if (!(i <= 5)) {
return _break();
} else {
(function(__iced_k) {
__iced_deferrals = new iced.Deferrals(__iced_k, {
filename: "iced.coffee"
});
setTimeout(__iced_deferrals.defer({
lineno: 3
}), 1000);
__iced_deferrals._fulfill();
})(function() {
return _next(console.log(i));
});
}
};
_while(__iced_k);
}).call(this);
Ah, OK, I see what's going on, my bad. It's that your node runtime can't find the iced libraries (and the bug you reported is now fixed with -I node
for me). Hmm, how we can debug this. I assume when you do require('iced-coffee-script')
from your node REPL that it also fails? Can you npm install another package you don't have and see if you can require those modules? Also, what version of node are you running? node --version
? It could be 10.04 ubuntu has an old version of node.js
Hmm, smth with paths seems to be broken. I've just updated node to 0.6.13, npm to 1.1.10, reinstalled iced-coffee-script
sudo npm remove iced-coffee-script -g
sudo npm install iced-coffee-script -g
and in REPL mode it still fails :(
var iced = require('iced-coffee-script').iced
Error: Cannot find module 'iced-coffee-script'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at repl:1:12
at REPLServer.eval (repl.js:80:21)
at repl.js:190:20
at REPLServer.eval (repl.js:87:5)
at Interface.<anonymous> (repl.js:182:12)
at Interface.emit (events.js:67:17)
Where i need to digg to solve issue with paths?
Okay, i've just tried to run in REPL mode on another machine
(ubuntu 11.10 x86_64, node v0.6.13, npm 1.1.10, coffee-script 1.2.0, iced-coffee-script 1.2.0t
)
ICS was installed by npm: npm install iced-coffee-script -g
and i've got the same error:
mark@db:~$ iced
iced> iced = require('iced-coffee-script').iced
Error: Cannot find module 'iced-coffee-script'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at /home/mark/.nvm/v0.6.13/lib/node_modules/iced-coffee-script/lib/coffee-script/coffee-script.js:126:25
at evalmachine.<anonymous>:3:13
at Object.eval (/home/mark/.nvm/v0.6.13/lib/node_modules/iced-coffee-script/lib/coffee-script/coffee-script.js:149:17)
at Interface.<anonymous> (/home/mark/.nvm/v0.6.13/lib/node_modules/iced-coffee-script/lib/coffee-script/repl.js:117:40)
at Interface.emit (events.js:67:17)
at Interface._onLine (readline.js:162:10)
at Interface._line (readline.js:426:8)
at Interface._ttyWrite (readline.js:603:14)
Any ideas?
You need to set the environment variable NODE_PATH
. If you're using bash as your shell, then add this line to your ~/.bashrc
:
export NODE_PATH=/usr/local/lib/node_modules
and type source ~/.bashrc
.
Let me know if this fixes it.
Or you can just try it as a one-off from the command line:
export NODE_PATH=/usr/local/lib/node_modules
In general, this is a bug with your node configuration. You probably can't get any module to work via NPM, I'm guessing, unless you have your path set.
Fuh, export NODE_PATH=/usr/lib/node_modules
made it work (without /local/
). Big thanks, Maxwell :)
One more thing:
To run globally: sudo npm install -dg iced-coffee-script
<- attention to -d flag
To run local: npm install iced-coffee-script
-> ~/node_modules/.bin/iced %filenname%.coffee
Hello, maybe smth is broken in current version but i cant run ICS without error on your tutorial site nor on server-side (node)
ICS site (client-side)
For example, go to http://maxtaco.github.com/coffee-script/ , click on
Try It
and paste sample codeRun
and watch console: after executing (chrome 17.0.963.79 m
) we've got an error:Now about server-side
My conf is:
Ubuntu 10.04, npm 1.1.4, nodejs v0.6.12, coffee-script 1.2.0 (-g), iced-coffee-script 1.2.0s (-g)
The same sample code snippet above works (
iced -I inline iced.coffee
) with error in the end:If i'm trying to run in
node
mode (iced iced.coffee
) with adding to the top of srciced = require('iced-coffee-script').iced
, i've got this err: