On Mon, Nov 18, 2013 at 8:48 PM, Rob Vig <[email protected]> wrote:
> I'm trying to learn Node...
>
> I saved a this in a sub dir.
>
> var http = require('http');
> http.createServer(function (req, res) {
>     res.writeHead(200, {'Content-Type': 'text/plain'});
>     res.end('Hello World Node on Unbuntu\n');})
> }.listen(3000, "127.0.0.1");
> console.log('Server running at http://127.0.0.1:3000/');
>
>
> Where the heck does it run?
>
>> crap.js
> ReferenceError: crap is not defined
>     at repl:1:2
>     at REPLServer.eval (repl.js:80:21)
>     at Interface.<anonymous> (repl.js:182:12)
>     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)
>     at ReadStream.<anonymous> (readline.js:82:12)
>     at ReadStream.emit (events.js:88:20)
>     at ReadStream._emitKey (tty.js:327:10)

That error message is because the REPL is trying to look up a property
called 'js' on an object 'crap' (which of course doesn't exist.)

Try `require('crap.js')` (sans backticks) or start node like this ->
node crap.js

Good luck!

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to