dolanmiu / MMM-awesome-alexa

Turn your MagicMirror into an 'Amazon Echo'. Activated when you say 'Alexa'.
https://awesome-alexa.js.org
MIT License
157 stars 51 forks source link

Unable to get refresh token #151

Closed hollanda1357 closed 5 years ago

hollanda1357 commented 5 years ago

I am new to raspberry pi and this is my first project, so I am just be being stupid and missing something, but I cannot figure out how to get a refresh token. I went through the install guide and when I ran $ npm run electron-rebuild , I was returned with this error:

mmm-awesome-alexa@1.0.0 electron-rebuild /home/pi/MagicMirror/modules/MMM-awesome-alexa
> electron-rebuild --pre-gyp-fix

✖ Rebuild Failed
An unhandled error occurred inside electron-rebuild
Could not detect abi for version 2.0.16 and runtime electron.  Updating "node-abi" might help solve this issue if it is a new release of electron

Error: Could not detect abi for version 2.0.16 and runtime electron.  Updating "node-abi" might help solve this issue if it is a new release of electron
    at Object.getAbi (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/node-abi/index.js:43:9)
    at _callee6$ (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/electron-rebuild/lib/rebuild.js:152:37)
    at tryCatch (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/electron-rebuild/node_modules/regenerator-runtime/runtime.js:63:40)
    at Generator.invoke [as _invoke] (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/electron-rebuild/node_modules/regenerator-runtime/runtime.js:337:22)
    at Generator.prototype.(anonymous function) [as next] (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/electron-rebuild/node_modules/regenerator-runtime/runtime.js:96:21)
    at Generator.tryCatcher (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/bluebird/js/release/util.js:16:23)
    at PromiseSpawn._promiseFulfilled (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/bluebird/js/release/generators.js:97:49)
    at /home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/bluebird/js/release/generators.js:201:15
    at _rebuild (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/electron-rebuild/lib/rebuild.js:613:18)
    at rebuild (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/electron-rebuild/lib/rebuild.js:624:28)
    at _callee$ (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/electron-rebuild/lib/cli.js:160:45)
    at tryCatch (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/electron-rebuild/node_modules/regenerator-runtime/runtime.js:63:40)
    at Generator.invoke [as _invoke] (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/electron-rebuild/node_modules/regenerator-runtime/runtime.js:337:22)
    at Generator.prototype.(anonymous function) [as next] (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/electron-rebuild/node_modules/regenerator-runtime/runtime.js:96:21)
    at Generator.tryCatcher (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/bluebird/js/release/util.js:16:23)
    at PromiseSpawn._promiseFulfilled (/home/pi/MagicMirror/modules/MMM-awesome-alexa/node_modules/bluebird/js/release/generators.js:97:49)
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! mmm-awesome-alexa@1.0.0 electron-rebuild: `electron-rebuild --pre-gyp-fix`
npm ERR! Exit status 255
npm ERR! 
npm ERR! Failed at the mmm-awesome-alexa@1.0.0 electron-rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2019-02-08T02_14_46_621Z-debug.log

I didn't really know how to fix this and kind of put it aside and kept going with the install guide (I assume I probably should not have done this), but when I got to the part where I was supposed to get my refresh token, I went through the AVS token helper and refresh token helper, and at the end of it all I got this error:

{"error_description":"The request has an invalid grant parameter : code","error":"invalid_grant"}

I went ahead onto the forums and the other issues that are on here to see if anyone had any solutions but couldn't really find any, so I tried all the other methods of getting a refresh token that I could find on here and couldn't get any of them to work. Not really sure what I've been doing wrong, and I've spent hours upon hours at this point trying to get it to work with no success. I can get you any other information you need from my end that might help, and any help would be much appreciated. Thanks so much.

smartmirrorkits commented 5 years ago

@hollanda1357

I hit the same issue with electron-rebuild. I think the issue is that it is using too old a version of that package.

After manually installing a more recent version of electron-rebuild I was able to fix the issue:

cd MMM-awesome-alexa
npm install electron-rebuild@1.8.2

I am going to send out a pull request to update this dependency.

dolanmiu commented 5 years ago

I have made a proper install guide and re-wrote the token tool, called Token Helper, this should be much more clear and will solve your issues:

https://awesome-alexa.js.org/#/installation?id=configuration