nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.44k stars 276 forks source link

npm install ...@types/node opens git but cant connect #4391

Closed evrality closed 2 weeks ago

evrality commented 1 month ago

Details

exatcly what it says in the title. i try to execute npm install typescript@types/node or npm install -D typescript@types/node it opens git that prompts me to connect to github, if i click with browser it throws me onto 127.0.0.1, which refuses to connect. the other option is with a code. everything works but doesn't connect and gives this error

npm info using npm@10.5.0
npm info using node@v20.12.2
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/types/node.git
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.

Node.js version

20.12.2

Example code

npm install typescript@types/node

Operating system

Microsoft Windows [Version 10.0.19045.4291]

Scope

npm install

Module and version

Not applicable.

RedYetiDev commented 1 month ago

Is your git setup correctly? Try running git --no-replace-objects ls-remote ssh://git@github.com/types/node.git.

If not, this is a git issue (probably, as the error says: git@github.com: Permission denied (publickey))