node.js install error require(‘http’);

489 Views Asked by At

I'm installing node.js on Ubuntu as per these instructions ( http://nodenode.com/post/1197688151/installing-node-js-on-ubuntu-screencast-tutorial )

and I'm recieving the following errors on the final step

I type node hello_node.js

my terminal replies

/home/joe/tmp/hello_node/hello_node.js:1
require(‘http’);
    ^

 node.js:201
    throw e; // process.nextTick error, or 'error' event on first tick
          ^
 SyntaxError: Unexpected token ILLEGAL
     at Module._compile (module.js:427:25)
      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)

So, it seems I 'require' http. Am I doing something wrong... or worse, stupid?

1

There are 1 best solutions below

3
On BEST ANSWER

You're not using normal single quotes. You have:

require(‘http’);

It should be:

require('http');