supermedium / moonrider

🌕🏄🏿 Surf the musical road among the stars. Side project built by two people in a few months to demonstrate WebXR.
https://moonrider.xyz
MIT License
569 stars 218 forks source link

npm install: Error while executing: /usr/bin/git ls-remote -h -t ssh://git@github.com/ngokevin/ziploader.git npm ERR! git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. npm ERR! Please make sure you have the correct access rights and the repository exists. #193

Closed fliodhais closed 4 months ago

fliodhais commented 4 months ago

Hi, I have tried installing using the recommended node versions (12, 11, 10) with their accompanying npm versions with no avail. I have checked other related issues AFAIK and none are identical though similar.

My hypothesis on error

  1. when cloning the this repo, it mentioned something about Git LFS and permission issues so I made a fork in order to copy it over. That might be the cause? Maybe I should try clone with normal git?

logs

https://pastebin.com/QYTAJd9D

eric@Flow:~/moonrider$ npm i --verbose
npm info it worked if it ends with ok
npm verb cli [ '/home/eric/.nvm/versions/node/v11.15.0/bin/node',
npm verb cli   '/home/linuxbrew/.linuxbrew/bin/npm',
npm verb cli   'i',
npm verb cli   '--verbose' ]
npm info using npm@6.14.6
npm info using node@v11.15.0
npm verb npm-session 23adde4f17aa83a1
npm info lifecycle @1.0.0~preinstall: @1.0.0
npm timing stage:loadCurrentTree Completed in 7ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 455ms
npm http fetch GET 304 https://registry.npmjs.org/aframe-atlas-uvs-component 626ms (from cache)
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 1252ms
npm timing stage:loadIdealTree Completed in 1918ms
npm timing stage:generateActionsToTake Completed in 306ms
npm verb correctMkdir /home/eric/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /home/eric/.npm/_locks/staging-c364b5dd21cae706.lock for /home/eric/moonrider/node_modules/.staging
npm timing audit submit Completed in 463ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 657ms
npm timing audit body Completed in 199ms
npm timing action:extract Completed in 1707ms
npm WARN tar ENOENT: no such file or directory, open '/home/eric/moonrider/node_modules/.staging/chalk-591a8045/package.json'
... // a bunch of missing "/home/eric/moonrider/node_modules/.staging/*" stuff
npm verb unlock done using /home/eric/.npm/_locks/staging-c364b5dd21cae706.lock for /home/eric/moonrider/node_modules/.staging
npm timing stage:rollbackFailedOptional Completed in 2ms
npm timing stage:runTopLevelLifecycles Completed in 5283ms
npm verb stack Error: exited with error code: 128
npm verb stack     at ChildProcess.<anonymous> (/home/linuxbrew/.linuxbrew/lib/node_modules/npm/node_modules/pacote/lib/util/finished.js:12:19)
npm verb stack     at ChildProcess.emit (events.js:193:13)
npm verb stack     at maybeClose (internal/child_process.js:999:16)
npm verb stack     at Socket.stream.socket.on (internal/child_process.js:403:11)
npm verb stack     at Socket.emit (events.js:193:13)
npm verb stack     at Pipe._handle.close (net.js:614:12)
npm verb cwd /home/eric/moonrider
npm verb Linux 5.15.133.1-microsoft-standard-WSL2
npm verb argv "/home/eric/.nvm/versions/node/v11.15.0/bin/node" "/home/linuxbrew/.linuxbrew/bin/npm" "i" "--verbose"
npm verb node v11.15.0
npm verb npm  v6.14.6
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@github.com/ngokevin/ziploader.git
npm ERR!
npm ERR! git@github.com: Permission denied (publickey).
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
npm verb exit [ 1, true ]
npm timing npm Completed in 5697ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/eric/.npm/_logs/2024-02-27T09_09_59_097Z-debug.log
frabul commented 4 months ago

I had the same problem. For me the issue was the fact that npm tries to access github trough ssh and tries to use the default key file, if the file has a password the process fails. So at the end of the day you should set your default key without password. To confirm that try to execute this command manually /usr/bin/git ls-remote -h -t ssh://git@github.com/ngokevin/ziploader.git

if it asks for a password or gives an error then you should solve that.

fliodhais commented 4 months ago

I had the same problem. For me the issue was the fact that npm tries to access github trough ssh and tries to use the default key file, if the file has a password the process fails. So at the end of the day you should set your default key without password. To confirm that try to execute this command manually /usr/bin/git ls-remote -h -t ssh://git@github.com/ngokevin/ziploader.git

if it asks for a password or gives an error then you should solve that.

Thanks for the suggestion but it doesn't seem to solve the issue. As @dmarcos suggested in discord, "add your public key to github?" worked. https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account

miva2 commented 3 months ago

Thanks frabul and fliodhais! I had to follow both steps. Adding SSH key generated on this device to github account then followed by the manual command to ziploader.

Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com' (...) to the list of known hosts.

Accepting this solved this issue.