hermanho / MMM-GooglePhotos

Display your photos on MagicMirror from Google Photos.
MIT License
172 stars 65 forks source link

Getting index.js:29 error #26

Closed nawaidrana closed 5 years ago

nawaidrana commented 5 years ago

I updated npm, updated my linux system, magicmirror is runnign fine, but after I installed MMM-Googlephotos, I cant seem to run it, I deleted MMM-GooglePhotos folder and reinstalled, but same issue. Can you please help? I did paste credentials.json after I installed MMM-GooglePhotos

node auth_and_test.js /home/pi/MagicMirror/modules/MMM-GooglePhotos/node_modules/open/index.js:29 ...options ^^^ SyntaxError: Unexpected token ... at createScript (vm.js:53:10) at Object.runInThisContext (vm.js:95:10) at Module._compile (module.js:543:28) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) at Function.Module._load (module.js:439:3) at Module.require (module.js:498:17) at require (internal/module.js:20:19) at Object. (/home/pi/MagicMirror/modules/MMM-GooglePhotos/auth.js:6:13)

eouia commented 5 years ago

I think you just did git pull. npm install is also needed to update this module.

nawaidrana commented 5 years ago

I did npm install within MMM-GooglePhotos folder, it goes through fine with one warn message but installs successfully

nawaidrana commented 5 years ago

But still getting that error after npm install, just want to make it clear.

eouia commented 5 years ago

Hmmm. it seems node module open problem. Try npm install --save open in MMM-GooglePhotos directory then try again.

nawaidrana commented 5 years ago

Just tried command, it ran successfully with a message of open@6.4.0 but when I run npm auth_and_test.js, still getting same error. I also tried the electron rebuild, but same error when I run js.

eouia commented 5 years ago

What is your node version? open/index.js is using ES6 style script. So it might probablly become an issue on old system.

nawaidrana commented 5 years ago

How do I check node version and how do I update it if needed?

eouia commented 5 years ago

In terminal,

node -v

... is called as rest or spread operator. In this case, it is spread operator and supported from node version 6.4.0

nawaidrana commented 5 years ago

7.10.1

eouia commented 5 years ago

Hmmm... weird. All I can say is just that your node cannot understand spread operator, and that is not the issue of module itself.

nawaidrana commented 5 years ago

Ok I downgraded my node to 6.4.0 and I am getting a different error this time: I am using magicmirror on raspberry pi, so not using it on windows.

node auth_and_test.js /home/pi/test1/MMM-GooglePhotos/node_modules/open/index.js:16 const wslToWindowsPath = async path => { ^^^^ SyntaxError: Unexpected identifier at Object.exports.runInThisContext (vm.js:76:16) at Module._compile (module.js:528:28) at Object.Module._extensions..js (module.js:565:10) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Object. (/home/pi/test1/MMM-GooglePhotos/auth.js:6:13) at Module._compile (module.js:556:32)

eouia commented 5 years ago

Hmmm.. I've tested to re-install on fresh RPI (RPI4, Raspbian Buster 2019-07-10, node v10.16.0, npm v6.9.0, gcc v7.3.0, MM v2.8.0) And there is no problem to install.

eouia commented 5 years ago

Have you any progress? I'll close this issue because there is no more feedback anymore. Feel free to reopen the issue when you have still the problem.