02-17-2021 14:34
02-17-2021 14:34
Hi Everyone,
I am testing the Fitbit CLI development, but when I try to compile a simple project, I see the following issue.
[23:21:26][error][build] package.json One or more build targets was invalid: mira
[23:21:26][error][build] package.json Error: Project configuration is invalid
My target is defined as:
"buildTargets": [
"mira"
],
and my dependencies are defined as:
"devDependencies": {
"@fitbit/sdk": "~4.2.0",
"@fitbit/sdk-cli": "^1.7.3"
},
It seems that everything must be okay, but this error indicates that mura is not a correct buildTarget. Mura is the target for Versa2 which is the watch I want to develop applications for.
Have you seen such issue and how have you resolved it?
Thank you for your help!
Answered! Go to the Best Answer.
06-29-2023 03:56
06-29-2023 03:56
I'm not sure if I have. I don't do regular programming work so I just followed the instructions on getting started of installing node, nvm and the rest.
I've followed the instructions on this and this is where I've ended up:
https://dev.fitbit.com/getting-started/
06-29-2023 04:26
06-29-2023 04:26
Hi @statsdata - you need to be in the route of the project folder for any instructions and there you will find the "package.json" file, if it exists. Note @Gondwana's very good help post earlier in this topic.
Author | ch, passion for improvement.
06-29-2023 12:54
06-29-2023 12:54
npx create-fitbit-app should have created a valid package.json.
09-19-2023 16:39
09-19-2023 16:39
Here's a link to the SDK5 blog announcement.
06-13-2024 10:27 - edited 06-13-2024 10:29
06-13-2024 10:27 - edited 06-13-2024 10:29
@AnElbow I'm currently going through this same thing myself. I followed the suggestion and got "npx create-fitbit-app myVersa2Project --sdk-version 4.3.0" to work as well. I tried following the getting started guide "https://dev.fitbit.com/getting-started/" and updated the code as shown here. Of course the versa 2 is using .gui files instead of .view but the same steps. I can get a red screen and even get it to work with a custom background image, but the clock doesn't show up. Just get an exception error with the JavaScript code, it appears with this part: const myLabel = document.getElementById("myLabel"); What did you do to get your basic clock to work?
06-13-2024 10:42
06-13-2024 10:42
HI @Kyle_Lampela - try changing the import to SDK 4 style
import document from "document";
Author | ch, passion for improvement.
06-13-2024 12:13
06-13-2024 12:13
@Guy_Thank you so much!! It's working perfect. I guess it's easy to miss that.
06-25-2024 07:38
06-25-2024 07:38
I'm glad someone else rescued you because my fix involved importing multiple different SDK versions and I can't remember which ones and why.