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.
Best AnswerI'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/
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
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.
npx create-fitbit-app should have created a valid package.json.
Best Answer@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?
Best Answer
Fitbit Product Experts Alumni are retired members of the Fitbit Product Expert Program. Learn more
HI @Kyle_Lampela - try changing the import to SDK 4 style
import document from "document";
Author | ch, passion for improvement.
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.
Best Answer