I am new to nodejs. I managed to install node.js on amazon EC2 server using this tutorial http://iwearshorts.com/blog/how-to-install-node-js-on-your-server/
But when I run the code I get this error. anyone know why this is happening and what I need to solve this.
node.js:197
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '/home/ubuntu/public_html/node_test.js'
at Function._resolveFilename (module.js:332:15)
at Function._load (module.js:279:25)
at Array.0 (module.js:481:10)
at EventEmitter._tickCallback (node.js:188:41)
You should post your primary
.jsfile that you are running in node so we can find your exact problem.My guess is you are passing the wrong value to
require. Pass a relative file path without the filename extension like this:var node_test = require("./public_html/node_test");