When I first run my coffeescript,I got error-- - node.js

when I execute this command,it is right--
coffee -v
it's output is right.`CoffeeScript version 1.6.1
but when I type
$ coffee
it got error,the log is below
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object #<Object> has no method 'split'
at Interface.setPrompt (readline.js:121:24)
at new REPLServer (repl.js:128:7)
at Object.start (repl.js:249:14)
at Object.start (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/repl.js:95:23)
at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:76:32)
at Object.<anonymous> (/usr/local/lib/node_modules/coffee-script/bin/coffee:7:41)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
I need your help

This is a design decision on the part of the CoffeeScript devs.
https://github.com/jashkenas/coffee-script/issues/2813
The CoffeeScript REPL no longer supports Node v0.6. You should be able to compile by passing a file though. If you want it to work, you will either need to use an older version of CoffeeScript, or a newer version of Node.

Related

ExpressJS and RethinkDb Tutorial Cannot read property 'prototype' of undefined

Very new to Db and JS and trying to learn ExpressJS, RethinkDb using a tutorial from this link.
https://github.com/rethinkdb/rethinkdb-example-nodejs-chat
I followed the instructions and hitting an error in basic module loading I suppose. Looks like some dependency problem or I'm probably missing some step.
As specified in the instruction, I have successfully setup rethinkDb and can see the DB explorer in
http://localhost:8080
But when node app is executed as specified in instructions, I"m hitting an error below. Any help in this regard please?
/Users/test/rethinkdb-example-nodejs-chat/node_modules/socket.io/lib/store.js:35
Store.prototype.__proto__ = EventEmitter.prototype;
^
TypeError: Cannot read property 'prototype' of undefined
at Object.<anonymous> (/Users/test/rethinkdb-example-nodejs-chat/node_modules/socket.io/lib/store.js:35:42)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Module.require (module.js:587:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/test/rethinkdb-example-nodejs-chat/node_modules/socket.io/lib/manager.js:16:13)
at Module._compile (module.js:643:30)
process.EventEmitter was deprecated and not working in new node version. This has been answered here
Can you rollback to older node.js version and see if you could run the tutorial
https://github.com/LearnBoost/websocket.io/issues/55

Node + Coffeescript + Zappa

I have been looking around for the best framework with nodejs. I am starting to lean twords Zappa. I was testing it out and everything was working fine until I started a new project and reinstalled it with npm.
Now any time I do anything with it, it throws this error.
This
require('zappa') ->
console.log "Hello World!"
Becomes
TypeError: Cannot read property 'prototype' of undefined
at Object.<anonymous> (/home/giodamelio/Projects/node-boilerplate/node_modules/zappa/lib/zappa.js:65:15)
at Object.<anonymous> (/home/giodamelio/Projects/node-boilerplate/node_modules/zappa/lib/zappa.js:702:4)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:31)
at Function._load (module.js:311:12)
at Module.require (module.js:359:17)
at require (module.js:375:17)
at Object.<anonymous> (/home/giodamelio/Projects/node-boilerplate/src/app.coffee:3:3)
at Object.<anonymous> (/home/giodamelio/Projects/node-boilerplate/src/app.coffee:52:4)
What happened?
Recently I just had a similar problem with zappa 0.3.3
Apparently the creator of zappa is on vacation and doesn't update to the current versions of node.js, but you may use zappajs instead. It's a fork that is a little more up-to-date.
npm install zappajs
And use require('zappajs') instead of require('zappa').

Cannot find module 'now' - nowjs and nodejs

I installed nodejs in my home folder (/home/myname/). No problems so far.
Then I installed nowjs and there was one warning:
Checking for node path: not found
Now when I try this example: http://nowjs.com/doc/example I get the error:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^ Error: Cannot find module 'now'
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> (/var/www/www.mydomain.de/htdocs/helloworld_server.js:7:13)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
Something with the paths is wrong I guess...anyone knows how to fix this?
Thanks
try this before :
npm config set global true && \
echo 'export NODE_PATH="'$(npm root -g)'"' >> ~/.bashrc && \
. ~/.bashrc

Basic db-mysql setup error

I just started using node.js for my project and tried making a connection to MySQL and inserting basic values. But I keep getting the following error:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Unable to load shared library /Users/****/nodeJS/node_modules/db-mysql/build/Release/mysql_bindings.node
at Object..node (module.js:472:11)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object.<anonymous> (/Users/****/nodeJS/node_modules/db-mysql/db-mysql.js:18:15)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
I did as was instructed, I specified the MYSQL_CONFIG environment variable:
$ export MYSQL_CONFIG=/usr/local/mysql/bin/mysql_config
maybe it's too late and I hope you solved this problem on your own, but it might be useful for other people experiencing the same issue.
What I did to solve it is to set the following variable:
export DYLD_LIBRARY_PATH=<your absolute path to mysql lib folder>
in my case it is:
export DYLD_LIBRARY_PATH=/usr/local/mysql-5.5.25-osx10.6-x86_64/lib/
Tested on MacOS Lion 10.7.4

Crytip node.js error

$ node server.js
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object #<Object> has no method 'bodyDecoder'
at HTTPServer.<anonymous> (/home/jrg/Realtime-Demo/settings.js:20:18)
at HTTPServer.configure (/home/jrg/Realtime-Demo/node_modules/express/lib/http.js:543:61)
at Object.<anonymous> (/home/jrg/Realtime-Demo/settings.js:18:5)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)
at Function._load (module.js:293:12)
at require (module.js:346:19)
at Object.<anonymous> (/home/jrg/Realtime-Demo/server.js:9:13)
at Module._compile (module.js:402:26)
When I try and run the Instagram node.js Realtime Demo project. The server is Ubuntu 10.04 (if that makes a difference, which I doubt).
This is not a duplicate of Express framework giving a very strange error - I tried the instructions there and they didn't work.
connect and express has bodyParser middleware, but not bodyDecoder.
It was renamed in the 1.0.0 version of the connect. It's a reason, why node.js projects must have package.json descriptor with dependences section, where components versions may be fixed.
You can install 0.5.10 version of connect or try to replace bodyDecoder with bodyParser

Resources