node.js - Cannot find module 'C:\server.js' -


i got following error.i searched , tried couldn't fix problem.

c:\>node server.js  module.js:340 throw err;       ^ error: cannot find module 'c:\server.js' @ function.module._resolvefilename (module.js:338:15) @ function.module._load (module.js:280:25) @ function.module.runmain (module.js:497:10) @ startup (node.js:119:16) @ node.js:901:3 

my server.js

var http = require('http'); http.createserver(function (req, res) { res.writehead(200, {'content-type': 'text/plain'}); res.end('hello world\n'); }).listen(1337, '127.0.0.1'); console.log('server running @ http://127.0.0.1:1337/'); 

how can run server.js node.i have installed node.js , typed command prompt npm install socket.io. seems ok. please help.

you didn't save server.js file in c:. use cd <dir> correct directory, try node command again.


Comments

Popular posts from this blog

stringtemplate - StringTemplate4 if conditional with length -

shader - OpenGL Shadow Map -