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

Is Windows development possible anymore?

ANSWERED

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:

npm i

> 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?

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

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.

View best answer in original post

Best Answer
0 Votes
5 REPLIES 5

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:

  "scripts": {
    "build""fitbit-build",
    "debug""fitbit"
  },

Here is my output from the terminal:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
PS C:\DH\Fitbit\DieUhrInsider> npm i
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.
> keytar@5.0.0 install C:\DH\Fitbit\DieUhrInsider\node_modules\keytar
> 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){}"
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon:
> https://opencollective.com/core-js
> https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
npm notice created a lockfile as package-lock.json. You should commit this file.
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.
added 494 packages from 379 contributors and audited 1440 packages in 17.898s
6 packages are looking for funding
  run `npm fund` for details
found 3 vulnerabilities (1 low, 2 high)
  run `npm audit fix` to fix them, or `npm audit` for details
PS C:\DH\Fitbit\DieUhrInsider>
PS C:\DH\Fitbit\DieUhrInsider> npx fitbit
Logged in as XXXX <XXXXXXX@XXXXX.XXX>
fitbit$
Best Answer
0 Votes

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.

Best Answer
0 Votes

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.

Best Answer
0 Votes

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.

Best Answer
0 Votes

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).

Peter McLennan
Gondwana Software
Best Answer
0 Votes