It appears that this simple app can't find the 'connect'
module after I just installed it in the file directory.
var connect = require ('connect');
connect.createServer(function(res, req, next) {
res.simpleBody("Connect you son of a beeeeetch");
}).listen(8000);
[email protected] node_modules/express
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected])
Dzs-Mac-Attax-2:PlsWrk Dz$ node test.js
module.js:340
throw err;
^
Error: Cannot find module 'connect'
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> (/Users/Dz/Documents/NodeTests/PlsWrk/test.js:1:77)
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)
you can use the following command, this might happen if you forget to install the connect serve-static module or installed it incorrectly.
$ npm install connect serve-static
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