hermanho / MMM-GooglePhotos

Display your photos on MagicMirror from Google Photos.
MIT License
162 stars 62 forks source link

Token Generation error using generate_token_v2.js #165

Closed mrfoxie closed 4 months ago

mrfoxie commented 1 year ago

Step 01:

cd ~/MagicMirror/modules/ git clone https://github.com/eouia/MMM-GooglePhotos.git cd MMM-GooglePhotos npm install

Step 2

Downloading credentials.json from Google API Console

Step 3

generating token using node generate_token_v2.js

Error

*[master][~/MagicMirror/modules/MMM-GooglePhotos]$ node generate_token_v2.js
node:internal/modules/cjs/loader:1026
  const err = new Error(message);
              ^

Error: Cannot find module '/home/pi/MagicMirror/modules/MMM-GooglePhotos/credentials.json'
Require stack:
- /home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/@google-cloud/local-auth/build/src/index.js
- /home/pi/MagicMirror/modules/MMM-GooglePhotos/generate_token_v2.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1026:15)
    at Function.Module._load (node:internal/modules/cjs/loader:871:27)
    at Module.require (node:internal/modules/cjs/loader:1098:19)
    at require (node:internal/modules/cjs/helpers:108:18)
    at authenticate (/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/@google-cloud/local-auth/build/src/index.js:48:21)
    at generate (/home/pi/MagicMirror/modules/MMM-GooglePhotos/generate_token_v2.js:13:24)
    at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-GooglePhotos/generate_token_v2.js:27:1)
    at Module._compile (node:internal/modules/cjs/loader:1196:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
    at Module.load (node:internal/modules/cjs/loader:1074:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/@google-cloud/local-auth/build/src/index.js',
    '/home/pi/MagicMirror/modules/MMM-GooglePhotos/generate_token_v2.js'
  ]
}
hermanho commented 11 months ago

Have you tried with the steps?

https://github.com/hermanho/MMM-GooglePhotos#get-tokenjson

  1. Then, you can download your credential json file from list. Downloaded file name would be client_secret_xxxx...xxx.json. rename it as credentials.json and save it to your MMM-GooglePhotos directory.
werox709 commented 11 months ago

I have the same problem were you able to solve it? I am running magic mirror on a docker container btw.

hermanho commented 11 months ago

I have the same problem were you able to solve it?

I am running magic mirror on a docker container btw.

Is the file credentials.json saved in the same directory in MMM-GooglePhotos inside the container?

mrfoxie commented 11 months ago

I have the same problem were you able to solve it?

I am running magic mirror on a docker container btw.

Is the file credentials.json saved in the same directory in MMM-GooglePhotos inside the container?

im not using docker container but I have placed the file in the same directory

hermanho commented 11 months ago

I have the same problem were you able to solve it? I am running magic mirror on a docker container btw.

Is the file credentials.json saved in the same directory in MMM-GooglePhotos inside the container?

im not using docker container but I have placed the file in the same directory

  1. What is your Node.js version?
  2. Could you please pull the 'dev' branch and run the command node generate_token_v2.js ?