Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

unable to connect to my fitbit account via visual studio code

ANSWERED

Hello everyone

I cannot connect to my fitbit acocunt via Visual Studio Code

When I type "npx fitbit" i have an 401 error

here is the text of the error

 

(node:17008) UnhandledPromiseRejectionWarning: Error: Fetch of https://api.fitbit.com:443/1/user/-/profile.json returned status 401 Unauthorized
at C:\Users\franc\Documents\fitbitapp\unicornwatchsense\node_modules\@fitbit\sdk-cli\lib\api\baseAPI.js:20:37
at processTicksAndRejections (internal/process/task_queues.js:97:5)
\api\userProfile.js:17:22)
at async main (C:\Users\franc\Documents\fitbitapp\unicornwatchsense\node_modules\@fitbit\sdk-cli\lib\cli.js:52:18)
(node:17008) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:17008) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are
not handled will terminate the Node.js process with a non-zero exit code.

 

I have this defect with a new project and an old project

Did someone face the same issue and how the issue was solved?

Thank you for help.

 

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

after a help on discord forum

the issue was due to the fact i "played" with the time of my PC

to solve this i launch in node on a command prompt: require('keytar').deletePassword('fitbit-sdk','production')

View best answer in original post

Best Answer
0 Votes
3 REPLIES 3

Hello

additional information

I am on windows

npx fitbit-build works only

the only command that doesn't work is: npx fitbit

i also tried that command after creating a new projet

is there a way to reset this command in node-modules from fitbit to enter again my credentials please?

 

Best Answer
0 Votes

maybe this?

fitbit$ logout
Best Answer
0 Votes

after a help on discord forum

the issue was due to the fact i "played" with the time of my PC

to solve this i launch in node on a command prompt: require('keytar').deletePassword('fitbit-sdk','production')

Best Answer
0 Votes