Get Even More Visitors To Your Blog, Upgrade To A Business Listing >> error error


I am attempting to run Nodejs with the module. I have installed the latest version of Nodejs, and I installed from a command prompt opened as an administrator (I'm in windows 7) using the command Npm Install The install appears to complete without any problems but when I attempt to run the following test program:

var io = require('').listen(80);

io.sockets.on('connection', function (socket) {
  socket.emit('news', { hello: 'world' });
  socket.on('my other event', function (data) {

I receive this error:

    throw err;
Error: Cannot find module ''
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object. (C:\xampp\htdocks\HTML5Game\impact\app.js:1:72)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function .Module._load (module.js:312:12)
    at Module.runMain (module.js:487:10)

In my searching I found some things about dependency problems, and some suggestions about incompatibility between and a version of Nodejs, but both were talking about older versions of and Node Thanks.

Problem courtesy of: APalmer


cd app
rm -rf node_modules
npm cache clean
npm install


cd app

Go to your app directory

rm -rf node_modules

Delete your currently installed modules

npm cache clean

Delete your npm cache, (some errors are caused by this)

npm install

Install modules listed in your package.json. If you don't have a package.json, you can install a specific module like this

npm install 


npm install

In your case, if you don't know what a package.json is, please read up on it here before continuing to work on nodejs.

Solution courtesy of: Pavan Kumar Sunkara


View additional discussion.

This post first appeared on Node.js Recipes, please read the originial post: here

Share the post error


Subscribe to Node.js Recipes

Get updates delivered right to your inbox!

Thank you for your subscription