Cannot start Node.js: permission denied

I'm running Node.js server on Ubuntu 12.04. When I try to start server with node server.js I get

fs.js:438
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^
Error: EACCES, permission denied '/home/scadge/nodejs/server.js'
    at Object.fs.openSync (fs.js:438:18)
    at Object.fs.readFileSync (fs.js:289:15)
    at Object.Module._extensions..js (module.js:473:44)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3

I also tried sudo node server.js and sudo su followed by node server.js - in all cases I get the same error.

Try as below.

Its permission issue.

  1. Open terminal
  2. Go the project directory.
  3. run chmod -R 777

On everything that is related with access denied can be fix with this.

Thank You.