Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Package.json provided to load dependencies #28

Open
sdetweil opened this issue Jan 22, 2020 · 3 comments
Open

No Package.json provided to load dependencies #28

sdetweil opened this issue Jan 22, 2020 · 3 comments

Comments

@sdetweil
Copy link

node-helper.js references python-shell node module,
but it is not installed.

users need to do this manually

there is an npm security fix which removes modules not referenced in any package.json file,
so this manual install WILL be deleted on the next npm install of any kind...

please do an npm init and add the info and dependency

@ArnoStrasbourg
Copy link

ArnoStrasbourg commented May 10, 2020

Hello sdetweil,

Does my problem have to do with your comment ?
I have followed the entire installation procedure, get the credentials properly.
Put the code but data do not refresh. And I have an error in the log

`/home/pi/.pm2/logs/mm-error.log last 15 lines:
0|mm | [2020-05-10 13:41:56.342] [ERROR] TypeError: PythonShell.run is not a function
0|mm | at Class.setCreds (/home/pi/MagicMirror/modules/MMM-fitbit/node_helper.js:32:15)
0|mm | at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-fitbit/node_helper.js:18:9)
0|mm | at Socket. (/home/pi/MagicMirror/js/node_helper.js:113:11)
0|mm | at Socket.emit (events.js:200:13)
0|mm | at /home/pi/MagicMirror/node_modules/socket.io/lib/socket.js:528:12
0|mm | at processTicksAndRejections (internal/process/task_queues.js:82:9)
0|mm | [2020-05-10 13:41:56.380] [ERROR] TypeError: PythonShell is not a constructor
0|mm | at Class.getData (/home/pi/MagicMirror/modules/MMM-fitbit/node_helper.js:43:25)
0|mm | at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-fitbit/node_helper.js:22:9)
0|mm | at Socket. (/home/pi/MagicMirror/js/node_helper.js:113:11)
0|mm | at Socket.emit (events.js:200:13)
0|mm | at /home/pi/MagicMirror/node_modules/socket.io/lib/socket.js:528:12
0|mm | at processTicksAndRejections (internal/process/task_queues.js:82:9)
.
.
.
0|mm | [2020-05-10 13:43:43.317] [LOG]
0|mm | Set credential request recieved.
0|mm | [2020-05-10 13:43:43.318] [LOG]
0|mm | {
0|mm | client_id: '22BR8T',
0|mm | client_secret: '51313d185cxxxxxxxxxxxxxxxxd141c99'
0|mm | }
0|mm | [2020-05-10 13:43:43.329] [LOG]
0|mm | Whoops! There was an uncaught exception...
0|mm | [2020-05-10 13:43:43.330] [ERROR] TypeError: PythonShell.run is not a function
0|mm | at Class.setCreds (/home/pi/MagicMirror/modules/MMM-fitbit/node_helper.js:32:15)
0|mm | at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-fitbit/node_helper.js:18:9)
0|mm | at Socket. (/home/pi/MagicMirror/js/node_helper.js:113:11)
0|mm | at Socket.emit (events.js:200:13)
0|mm | at /home/pi/MagicMirror/node_modules/socket.io/lib/socket.js:528:12
0|mm | at processTicksAndRejections (internal/process/task_queues.js:82:9)
0|mm | [2020-05-10 13:43:43.334] [LOG] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
0|mm | [2020-05-10 13:43:43.335] [LOG] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
0|mm | [2020-05-10 13:43:43.336] [LOG] Initial run request recieved.
0|mm | [2020-05-10 13:43:43.338] [LOG] Running getData.py
0|mm | [2020-05-10 13:43:43.339] [LOG] Whoops! There was an uncaught exception...
0|mm | [2020-05-10 13:43:43.342] [LOG] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
0|mm | [2020-05-10 13:43:43.342] [LOG] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
0|mm | [2020-05-10 13:43:43.344] [LOG] [NewPIR] Initialize...
0|mm | [2020-05-10 13:43:43.340] [ERROR] TypeError: PythonShell is not a constructor
0|mm | at Class.getData (/home/pi/MagicMirror/modules/MMM-fitbit/node_helper.js:43:25)
0|mm | at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-fitbit/node_helper.js:22:9)
0|mm | at Socket. (/home/pi/MagicMirror/js/node_helper.js:113:11)
0|mm | at Socket.emit (events.js:200:13)
0|mm | at /home/pi/MagicMirror/node_modules/socket.io/lib/socket.js:528:12
0|mm | at processTicksAndRejections (internal/process/task_queues.js:82:9)

`
Thanks for your answer.

@sdetweil
Copy link
Author

they changed how it needs to be initialized

a simple google search on the error yields a code change
instead of

var PythonShell = require('python-shell')
or 
let PythonShell = require('python-shell')

change to

let {PythonShell} = require('python-shell')

not a MM problem, its a module problem

also MMM-Fitbit is depricated, use MMM-Fitbit2

@ArnoStrasbourg
Copy link

Yes, I saw it. Thank you @sdetweil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants