I am attempting to run the demo for the mobwrite node.js package. First I installed the mobwrite package (npm install mobwrite
) and then entered the following command:
node -e "require('mobwrite').quickserve()"
A demo server should start, but the following error is thrown:
module.js:340 throw err; ^Error: Cannot find module './lib/middleware' at Function.Module._resolveFilename (module.js:388: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> (PATH_TO_MODULES\mobwrite.js:2:18) 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 Module.require (module.js:364:17) at require (module.js:380:17) at [eval]:1:1 at Object.<anonymous> ([eval]-wrapper:6:22) at Module._compie (module.js:456:26) at evalScript (node.js:532:25) at startup (node.js:80:7) at node.js:901:3
This originates from the mobwrite.js file, in which the package needs to include a middleware file (middleware.coffee
) which is stored in a lib folder:
require("coffee-script")middleware = require("./lib/middleware")module.exports = middleware
I have looked at the answers to similar posts on SO, but nothing has solved my problem so far. How can I overcome this error?