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

I cannot lauch command "npx fitbit" with "Host key verification failed"

ANSWERED

When I launch fitbit shell with "npx fitbit" on PowerShell on windows10, I got an error as below. Even thought I didn't get any error yesterday...

It seems authentication information around git used in npx command caused this error.

How to solve this problem?

Error:

 

npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://git at github.com/p-m-p/node-oauth.git
npm ERR!
npm ERR! Host key verification failed.
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128

 

! I replaced "@" in git url to "at" because it seems this url is not permitted to write here. 

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

You definitely need package.json. You'd also need to do

 

npm i

 

to repopulate node_modules based on what package.json specifies.

But I don't think this is the heart of the issue. I can't see why git is being invoked at all. Maybe it's trying to download and build a missing component (oauth? keytar?).

Make sure you run npx from the folder containing package.json. You could also try using cmd instead of powershell (and definitely not WSL).

Peter McLennan
Gondwana Software

View best answer in original post

Best Answer
7 REPLIES 7

Additional info:

I tried to clear npm cache by following way, same error is given...

rm package-lock.json
npm cache clean --force              
rm -rf node_modules 
Best Answer
0 Votes

I don't know what I'm talking about, but I didn't think that the default installation of node or Fitbit CLI depended on git. If you've got any git-related files in your project folder, they could be implicated.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

I mean I'm not able to start fitbit shell with "npx fitbit" on PowerShell.

Until yesterday, I was able to successfully do it, didn't modify files and folders related to configuration (build/, node_modules/, package.json, package-lock.json, tsconfig.json).

I've tried to delete following folders and files to clear dependences. But, still got the error.

Build/

node_modules/

package.json

package-lock.json

tsconfig.json

Best Answer
0 Votes

You definitely need package.json. You'd also need to do

 

npm i

 

to repopulate node_modules based on what package.json specifies.

But I don't think this is the heart of the issue. I can't see why git is being invoked at all. Maybe it's trying to download and build a missing component (oauth? keytar?).

Make sure you run npx from the folder containing package.json. You could also try using cmd instead of powershell (and definitely not WSL).

Peter McLennan
Gondwana Software
Best Answer

>You definitely need package.json. You'd also need to do npm i to repopulate node_modules based on what package.json specifies.

Thank you for tell me.

I've resolved by re-creating fitbit directory with "npx create-fitbit-app my-first-clock" and replaced developed files (like index.js) with ones in my-first-clock.

I'll share npm log to you FYI. I can find npm tried to access "https://registry.npmjs.org/lodash" to get some missing component of fitbit, and then npm also accessed to get authorized for "https://registry.npmjs.org/lodash". (oauth provided by git is necessary to access lodash?) But, npm got error from github because of "Permission denied".

npm log:

! replaced github.com -> github.c0m

 

 

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\xxxx\\AppData\\Roaming\\nvm\\v14.21.3\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'fitbit@latest',
1 verbose cli   '--global',
1 verbose cli   '--prefix',
1 verbose cli   'C:\\Users\\xxxx\\AppData\\Roaming\\npm-cache\\_npx\\19492',
1 verbose cli   '--loglevel',
1 verbose cli   'error',
1 verbose cli   '--json'
1 verbose cli ]
2 info using npm@6.14.18
3 info using node@v14.21.3
4 verbose npm-session 1514837ffc255369
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/fitbit 41ms (from cache)
8 silly pacote tag manifest for fitbit@latest fetched in 62ms
9 timing stage:loadCurrentTree Completed in 79ms
10 silly install loadIdealTree
11 silly install cloneCurrentTreeToIdealTree
12 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
13 silly install loadShrinkwrap
14 timing stage:loadIdealTree:loadShrinkwrap Completed in 2ms
15 silly install loadAllDepsIntoIdealTree
16 silly resolveWithNewModule fitbit@0.0.7 checking installable status
17 http fetch GET 304 https://registry.npmjs.org/lodash 148ms (from cache)
18 silly pacote range manifest for lodash@~1.3.1 fetched in 153ms
19 silly resolveWithNewModule lodash@1.3.1 checking installable status
20 silly fetchPackageMetaData error for oauth@github:p-m-p/node-oauth Error while executing:
20 silly fetchPackageMetaData C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://git@github.c0m/p-m-p/node-oauth.git
20 silly fetchPackageMetaData
20 silly fetchPackageMetaData git@github.c0m: Permission denied (publickey).
20 silly fetchPackageMetaData fatal: Could not read from remote repository.
20 silly fetchPackageMetaData
20 silly fetchPackageMetaData Please make sure you have the correct access rights
20 silly fetchPackageMetaData and the repository exists.
20 silly fetchPackageMetaData
20 silly fetchPackageMetaData exited with error code: 128
21 timing stage:rollbackFailedOptional Completed in 1ms
22 timing stage:runTopLevelLifecycles Completed in 23728ms
23 verbose stack Error: exited with error code: 128
23 verbose stack     at ChildProcess.<anonymous> (C:\Users\xxxx\AppData\Roaming\nvm\v14.21.3\node_modules\npm\node_modules\pacote\lib\util\finished.js:12:19)
23 verbose stack     at ChildProcess.emit (events.js:400:28)
23 verbose stack     at maybeClose (internal/child_process.js:1088:16)
23 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
24 verbose cwd C:\Users\xxxx\Documents\fitbit_project\my-first-clock
25 verbose Windows_NT 10.0.19045
26 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\xxxx\\AppData\\Roaming\\nvm\\v14.21.3\\node_modules\\npm\\bin\\npm-cli.js" "install" "fitbit@latest" "--global" "--prefix" "C:\\Users\\xxxx\\AppData\\Roaming\\npm-cache\\_npx\\19492" "--loglevel" "error" "--json"
27 verbose node v14.21.3
28 verbose npm  v6.14.18
29 error Error while executing:
29 error C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://git@github.c0m/p-m-p/node-oauth.git
29 error
29 error git@github.c0m: Permission denied (publickey).
29 error fatal: Could not read from remote repository.
29 error
29 error Please make sure you have the correct access rights
29 error and the repository exists.
29 error
29 error exited with error code: 128
30 verbose exit [ 1, true ]

 

 

 

Best Answer

Interesting. I wonder what would have happened if git wasn't installed.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

I don't know how it goes without git. But, I guess npm internally access to github to get authorized even if I did not install git on my PC🤔

Best Answer
0 Votes