how do I execute "node server.js" in codelab?

I am studying tutorial of codelab at https://bitbucket.org/webrtc/codelab/src/50a47bb092483fd7ca27998a365dff434919bf89?at=master

I've never used node.js before and wondering what this means under the "Running The Examples" section. I've installed node.js and installed which was straightforward but when I type:

node server.js

and I get

node: Command not found.

I am at below directory.and under that step6 directory, there is server.js exist.

xxxx@xxxx:/Users/xxxx/webrtc-codelab-50a47bb09248/complete/step6>

could anyone help with how node.js works?

Below is what i get when i type /usr/local/bin/node server.js under the same directory..

module.js:340
throw err;
      ^
Error: Cannot find module 'node-static'

at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (/Users/danielle/webrtc-codelab-50a47bb09248/complete/step6/server.js:1:76)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)

This is what I got when I did npm install -g node-static

npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/node-static'
npm ERR!  { [Error: EACCES, mkdir '/usr/local/lib/node_modules/node-static']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/node-static',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/usr/local/lib/node_modules/node-static',
npm ERR!   fstream_class: 'DirWriter',
npm ERR!   fstream_stack: 
npm ERR!    [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR!      '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR!      'Object.oncomplete (fs.js:107:15)' ] }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "node-static"
npm ERR! cwd /Users/danielle
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.14
npm ERR! path /usr/local/lib/node_modules/node-static
npm ERR! fstream_path /usr/local/lib/node_modules/node-static
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/node-static'
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/danielle/npm-debug.log
npm ERR! not ok code 0

When I type node server.js under the /usr/local/bin I got..

module.js:340
    throw err;
          ^
Error: Cannot find module '/usr/local/bin/server.js'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

Your node is not set to your PATH.

because your node is set to usr/local/bin/. Try this

set path = ($path /usr/local/bin)

restart your terminal and just run node you should get it working.

If it doesn't try to get some tutorial how to set PATH in your OS.

You need to install node-static. If you use the -g parameter to npm it requires sudo privileges so skip that and do a normal install with

npm install node-static

Then run

nodejs server.js