I am unaware what is causing this problem, because I thought it should be working. I do have expressed installed, at least according to npm:
C:\Users\phucker\Desktop>node init.js
module.js:340
throw err;
^
Error: Cannot find module 'express'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.<anonymous> (C:\Users\phucker\Desktop\init.js:1:77)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
C:\Users\phucker\Desktop>npm express -v
1.3.2
C:\Users\phucker\Desktop>
the code contained in init.js is
var express = require('express');
var app = express();
app.get('/', function(req, res){
res.send('hello world');
});
app.listen(3000);
You need to have express
installed locally in your node_modules
folder. Check your node_modules
and install it again if it is not there
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With