kevana / food-finder

An app to help you find leftover food in conference rooms after lunch meetings.
1 stars 0 forks source link

Error running in Docker: The GCM API Key should be a non-emtpy string. #1

Open micmart opened 6 years ago

micmart commented 6 years ago

Hi, I'm keen to try this app out! Not sure if I'm doing anything wrong here but I get the following error when trying to run using docker on OSX.

  1. I cloned your repo into my home area on my Mac
  2. I ran docker build -t food-finder . in the food-finder folder which seemed to have worked fine
  3. When executing docker run -it --rm --name food-finder food-finder I then get:
martm106-3AH03Y:~ martm106$ docker run -it --rm --name food-finder food-finder
npm info it worked if it ends with ok
npm info using npm@3.8.6
npm info using node@v6.1.0
npm info lifecycle food-finder@0.0.0~prestart: food-finder@0.0.0
npm info lifecycle food-finder@0.0.0~start: food-finder@0.0.0

> food-finder@0.0.0 start /usr/src/app
> node ./bin/www

/usr/src/app/node_modules/web-push/index.js:96
    throw new Error('The GCM API Key should be a non-emtpy string.');
    ^

Error: The GCM API Key should be a non-emtpy string.
    at Object.setGCMAPIKey (/usr/src/app/node_modules/web-push/index.js:96:11)
    at Object.<anonymous> (/usr/src/app/routes/index.js:8:9)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/src/app/app.js:8:14)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Module.require (module.js:466:17)

npm info lifecycle food-finder@0.0.0~start: Failed to exec start script
npm ERR! Linux 4.9.36-moby
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start"
npm ERR! node v6.1.0
npm ERR! npm  v3.8.6
npm ERR! code ELIFECYCLE
npm ERR! food-finder@0.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the food-finder@0.0.0 start script 'node ./bin/www'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the food-finder package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node ./bin/www
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs food-finder
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls food-finder
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /usr/src/app/npm-debug.log
kevana commented 6 years ago

You'll need to set the GCM_API_KEY environment variable in your container. See here for where it's used.