1

I'm a beginer with node.js. I installed node on Ubuntu 12.04 and it works fine for simple simple apps. I also installed express using:

npm install -g express

I believe the installation worked fine since I get no errors but right now I want to run one of their apps from the examples (the mvc one) and I get the following error:

module.js:340
    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.<anonymous> (/home/andreii/Desktop/node/mvc/index.js:2:15)
    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:492:10)

Any ideas about how can I solve this problem? Thanks a lot guys!

3
  • It would be nice if you post the actual example code that gives you that error.
    – lanzz
    Oct 21, 2012 at 13:37
  • Hi lanzz, You can find it here: github.com/visionmedia/express/tree/master/examples/mvc
    – Andrei Ion
    Oct 21, 2012 at 13:43
  • 2
    So, you believe that in order to help you, we should make extra effort just to figure out what your problem is? Isn't this a bit arrogant?
    – lanzz
    Oct 21, 2012 at 14:49

1 Answer 1

2
var express = require('../..');

Simply change the first line of your code like this

var express = require('express');

All well goes fine after that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.