How do I deploy a specific commit of parse server on AWS EB?
I tried to:
Change the package.json
of parse-server-example to:
"dependencies": { "parse-server": "parse-community/parse-server#commit-hash" }
Run npm install
The server fails to start with error:
Error: Cannot find module '/var/app/current/node_modules/parse-server/lib/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (internal/modules/cjs/loader.js:316:19)
at Function.Module._findPath (internal/modules/cjs/loader.js:705:18)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:969:27)
at Function.Module._load (internal/modules/cjs/loader.js:864:27)
at Module.require (internal/modules/cjs/loader.js:1044:19)
at require (internal/modules/cjs/helpers.js:77:18)
at Object.<anonymous> (/var/app/current/index.js:10:19)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32) {
code: 'MODULE_NOT_FOUND',
path: '/var/app/current/node_modules/parse-server/package.json',
requestPath: 'parse-server'
It works when I don't point the dependency to a commit, but it doesn't work with a commit - why?
If you look at the Parse Server GitHub repository, you will see that there is no lib/
folder over there. The lib/
is at the .gitignore
file and you will only find it in the npm package. That's why it fails when you try to install directly from the GitHub repository.
The workaround is:
npm install
.lib/
folder from .gitignore
, commit, and push it to your own fork.