I deployed NodeJS/ExpressJS web app in Modulus.io
In package.json, I already included the module mongoose-uniqueslugs:
"dependencies": {
...
"mongoose": "3.6.11",
"mongoose-uniqueslugs": "*",
...
}
In Modulus.io dashboard, I don't see the folder node_module but I think this is fine since the module is defined in package.json.
I deployed the app with modulus deploy CLI. No displayed error at all.
When browsing the app, it keeps on reloading, so I suspect the app have errors.
I viewed the logs with modulus project logs:
module.js:340
throw err;
^
Error: Cannot find module 'mongoose-uniqueslugs'
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> (/mnt/data/2/models/Category.js:2:27)
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)
[2013-07-22T14:49:45.584Z] Application restarted with pid undefined
Line 2 of Category.js is:
, mongooseUniqueSlugs = require('mongoose-uniqueslugs');
I believe we got this figured out. It was caused by an npm shrinkwrap file that was missing the dependency. When npm install is run, a shrinkwrap file will override a package.json file.