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

Can't run fitbit app in command line because of keytar module

We are in the process of building a simple app for a Versa 2, that just sends heart rate data from the fitbit to the companion app.

 

The app works fine on the simulator. When it is run on the actual versa 2, it says 'Sideload of app failed. Connected device does not support API version requested by app'. Our versa 2 is brand new so we recognise it may be because the newest update hasn't come through yet.

 

Following the instructions in https://community.fitbit.com/t5/SDK-Development/Sideload-of-app-failed-Connected-device-does-not-sup... we downloaded our app from fitbit studio and attempted to run it on the command line (both on a windows and on a mac).

 

However, when this happens, we get a big stack of errors to do with the 'keytar' module in the fitbit/sdk-cli module. These errors are very annoying and preventing us from continuing as we cannot get past them to perform npx fitbit-build.

 

In the event we don't include fitbit/sdk-cli, the errors won't come up, however running 'npx fitbit' after 'npx fitbit-build' tell us it can't find the executable to run.

 

Any help would be greatly appreciated!!

Best Answer
0 Votes
2 REPLIES 2

keytar is essential for authenticating the CLI tools with Fitbit's server.

 

Unfortunately, keytar can be a pain to install because (I think) it contains some native and python code, whereas most node modules are JS. If the precompiled version of keytar that comes with node isn't compatible with your environment, node can try to compile keytar, but it needs to be able to find a compatible python interpreter and C++ (I think) compiler. You may need to install those as prerequisites. Read up on keytar installation and follow the instructions to build a working keytar.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

I fixed this issue with Node.js version 14; anything higher produced this error, and anything lower than version 10 was incompatible. Because I'm using a MacBook, I used the following commands:

 

 

brew install nvm
nvm install v14
nvm alias default 14.21.3
npx create-fitbit-app app-name
cd app-name
npx fitbit

 

 

 

 

 

Best Answer