I am trying to deploy a NodeJs App : DemocracyOs, on apache with Passenger.
The Makfile of this project runs npm :
npm run start
The documentation of Passenger requires to enter the target json file app.js
.
In that case I understand this is index.js.
However, when I try to launhc passenger with this file, or to run it directly with
node index.js
... I get the following error :
module.js:471
throw err;
^
Error: Cannot find module 'lib/config'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/raphael/democracyos/index.js:2:16)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
I guess npm does something specific with package.json, which defines some kind of mapping :
"browser": {
"lib/config": "lib/config/config"
}
How can I get Passenger behave like npm ?