docker composer-up - Error: Cannot find module 'pg'
Closed this issue · 2 comments
Current Behavior
dan@danwork2:/media/dan/data/books/epub-press$ docker-compose up
Starting epubpress_postgres_1 ...
Starting epubpress_postgres_1 ... done
Starting epubpress_server_1 ...
Starting epubpress_server_1 ... done
Attaching to epubpress_postgres_1, epubpress_server_1
postgres_1 | 2019-06-15 03:46:22.864 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
postgres_1 | 2019-06-15 03:46:22.864 UTC [1] LOG: listening on IPv6 address "::", port 5432
postgres_1 | 2019-06-15 03:46:22.880 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres_1 | 2019-06-15 03:46:22.922 UTC [27] LOG: database system was shut down at 2019-06-15 03:44:29 UTC
postgres_1 | 2019-06-15 03:46:22.940 UTC [1] LOG: database system is ready to accept connections
server_1 |
server_1 | > epub-press@1.0.0 start:docker /usr/src/epub-press
server_1 | > npm run wait:db && sequelize db:migrate && npm start
server_1 |
server_1 |
server_1 | > epub-press@1.0.0 wait:db /usr/src/epub-press
server_1 | > node scripts/wait-for-postgres.js
server_1 |
server_1 | module.js:550
server_1 | throw err;
server_1 | ^
server_1 |
server_1 | Error: Cannot find module 'pg'
server_1 | at Function.Module._resolveFilename (module.js:548:15)
server_1 | at Function.Module._load (module.js:475:25)
server_1 | at Module.require (module.js:597:17)
server_1 | at require (internal/module.js:11:18)
server_1 | at Object. (/usr/src/epub-press/scripts/wait-for-postgres.js:1:82)
server_1 | at Module._compile (module.js:653:30)
server_1 | at Object.Module._extensions..js (module.js:664:10)
server_1 | at Module.load (module.js:566:32)
server_1 | at tryModuleLoad (module.js:506:12)
server_1 | at Function.Module._load (module.js:498:3)
Expected Behavior
I would expect the service to start without errors, and to be able to find the 'pg' module.
Steps to reproduce
System Information
This is probably related to #22. Node modules are not installed within the container.
This should be fixed thanks to @saesh ! :)