01-07-2020 17:52 - edited 01-07-2020 17:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

SunsetRunner
01-07-2020 17:52 - edited 01-07-2020 17:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Since CLI version 1.6, I have been unable to develop on Windows. I was previously using Powershell to run the Fitbit CLI, but that no longer works. I have updated my devDependencies with 4.0.0/1.7.0 but I am still having the same problems.
Attempting to `npm install` in Powershell, CMD, Git Bash, or WSL (Ubuntu) all give me the same error:
> keytar@5.0.0 install C:\project\node_modules\keytar
> prebuild-install || node-gyp rebuild
At line:1 char:18
+ prebuild-install || node-gyp rebuild
+ ~~
The token '||' is not a valid statement separator in this version.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidEndOfLine
I was able to fix this error on WSL by installing libsecret-1-dev with `sudo apt-get install libsecret-1-dev`
I found that solution here: https://github.com/serverless/serverless-azure-functions/issues/88#issuecomment-341232450
But, after I got that squared away and my NPM install was successful, I was unable to run the fitbit npx commands. Then I read the CLI page and found that WSL was not officially supported.
I have been working on developing a game for Fitbit for over 1 year now, but the last 4 months have been utterly unproductive because I can't actually test my code.
I am desperate for some help here. Are other people developing on Windows? What are we supposed to do?
I mean, when the Fitbit CLI page says that you can develop on Windows but you can't use WSL, what are we expected to use?
Can someone at Fitbit please dust off a Windows machine and try using their CLI? Or maybe I'm the only one having this problem?
Answered! Go to the Best Answer.

Accepted Solutions
01-16-2020 20:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

SunsetRunner
01-16-2020 20:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Windows version: 10.0.18362.145
Node.js version: 10.16.2
NPM version: 6.9.0
Powershell version: 5.1.18362.145 (just run $PSVersionTable.PSVersion.ToString() )
I get this when I run npm install:
PS C:\www\herobit> npm i
> keytar@4.6.0 install C:\www\herobit\node_modules\keytar
> prebuild-install || node-gyp rebuild
At line:1 char:18
+ prebuild-install || node-gyp rebuild
+ ~~
The token '||' is not a valid statement separator in this version.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidEndOfLine
npm WARN herobit No description
npm WARN herobit No repository field.
npm WARN herobit No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keytar@4.6.0 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keytar@4.6.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\namk\AppData\Roaming\npm-cache\_logs\2020-01-17T01_23_14_232Z-debug.log
I switch to Yarn 1.21.1 instead of NPM and everything started working properly. I don't know what's wrong with NPM but it all works with Yarn. The issue is somewhere between the following modules: prebuild-install, keytar, node-gyp.

01-08-2020 08:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

01-08-2020 08:03
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I am developing for my Fitbit Ionic using Windows 10 (Version 10.0.18363 build 18363) without any issues.
Using Visual Studio Code as IDE and building and installing from the Terminal works fine for me.
Both npm i and npx fitbit
Does your package.json contain the following script:
Here is my output from the terminal:
Copyright (C) Microsoft Corporation. All rights reserved.
npm WARN deprecated rollup-plugin-commonjs@10.1.0: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-commonjs.
npm WARN deprecated rollup-plugin-node-resolve@5.2.0: This package has been deprecated and is no longer maintained.
Please use @rollup/plugin-node-resolve.
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
> prebuild-install || node-gyp rebuild
> core-js@2.6.11 postinstall C:\DH\Fitbit\DieUhrInsider\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
npm WARN gulp-zip@5.0.1 requires a peer of gulp@>=4 but none is installed. You must install peer dependencies yourself.
npm WARN @Fitbit/jsonrpc-ts@3.0.3 requires a peer of fp-ts@2.2.0 but none is installed. You must install peer dependencies yourself.
run `npm fund` for details
run `npm audit fix` to fix them, or `npm audit` for details
PS C:\DH\Fitbit\DieUhrInsider>
Logged in as XXXX <XXXXXXX@XXXXX.XXX>
fitbit$

01-10-2020 02:37
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


01-10-2020 02:37
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Won't support WSL, but you should be able to just use the standard Windows terminal. Ensure your node version is up to date. It needs to be at least 8 upwards.

01-10-2020 03:38
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



01-10-2020 03:38
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Node 8 may work, but I'd strongly suggest Node 10, since Node 8 is now unsupported as it's reached end of life. As we keep the SDK updated, many of our dependencies will drop their Node 8 support as a result of it being EOL, so we must also drop our Node 8 support.

01-16-2020 20:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

SunsetRunner
01-16-2020 20:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Windows version: 10.0.18362.145
Node.js version: 10.16.2
NPM version: 6.9.0
Powershell version: 5.1.18362.145 (just run $PSVersionTable.PSVersion.ToString() )
I get this when I run npm install:
PS C:\www\herobit> npm i
> keytar@4.6.0 install C:\www\herobit\node_modules\keytar
> prebuild-install || node-gyp rebuild
At line:1 char:18
+ prebuild-install || node-gyp rebuild
+ ~~
The token '||' is not a valid statement separator in this version.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidEndOfLine
npm WARN herobit No description
npm WARN herobit No repository field.
npm WARN herobit No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keytar@4.6.0 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keytar@4.6.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\namk\AppData\Roaming\npm-cache\_logs\2020-01-17T01_23_14_232Z-debug.log
I switch to Yarn 1.21.1 instead of NPM and everything started working properly. I don't know what's wrong with NPM but it all works with Yarn. The issue is somewhere between the following modules: prebuild-install, keytar, node-gyp.

01-16-2020 20:30
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


01-16-2020 20:30
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I'm wondering if the problem is actually the ||
It seems like it's trying to run something targeted at a different environment (linux/apple).
Gondwana Software

