Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm install fails on Windows with git authentication error #1715

Closed
SimonEast opened this issue Mar 27, 2021 · 2 comments
Closed

npm install fails on Windows with git authentication error #1715

SimonEast opened this issue Mar 27, 2021 · 2 comments

Comments

@SimonEast
Copy link

Describe the bug
Installation fails with a git error. This didn't happen with another npm package I tried, so I wonder if it's something to do with eleventy.

To Reproduce
I run the command:

npm install -g "@11ty/eleventy"

Expected behavior
I expected the install to complete successfully.

Log output

D:\Dev\Eleventy-Test>npm install -g "@11ty/eleventy"
The system cannot find the path specified.
(node:6540) Warning: Accessing non-existent property 'Reader' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
(node:6540) Warning: Accessing non-existent property 'Reader' of module exports inside circular dependency
npm WARN `git config --get remote.origin.url` returned wrong result (git@github.com:11ty/eleventy)
npm ERR! git clone git@github.com:11ty/eleventy Cloning into bare repository 'C:\Users\Simon\AppData\Roaming\npm-cache\_
git-remotes\git-github-com-11ty-eleventy-0276e50c'...
npm ERR! git clone git@github.com:11ty/eleventy git@github.com: Permission denied (publickey).
npm ERR! git clone git@github.com:11ty/eleventy fatal: Could not read from remote repository.
npm ERR! git clone git@github.com:11ty/eleventy
npm ERR! git clone git@github.com:11ty/eleventy Please make sure you have the correct access rights
npm ERR! git clone git@github.com:11ty/eleventy and the repository exists.
npm ERR! addLocal Could not install 11ty/eleventy

Environment:

  • OS and Version: Windows 10
  • Eleventy Version: none (install failed)

Additional context
This could potentially be a bug with my git/ssh setup, but I've just reinstalled git, node, and deleted the npm cache, but the error persists.

Anyone know what might be causing that?

@SimonEast
Copy link
Author

SimonEast commented Mar 27, 2021

I also cannot do a git clone on the repo:

D:\Dev\Eleventy-Test>git clone git@github.com:11ty/eleventy
Cloning into 'eleventy'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

I did a little more digging, and I think this error occurs because:

  1. npm is trying to install Eleventy using git via SSH URL (not the public HTTPS one)
  2. I haven't yet setup a Github account with a valid key pair

I can try to do #2, but should this be normal (to require installers to have a valid Github account with SSH keys)?

@SimonEast
Copy link
Author

Turns out I had multiple versions of node and npm installed on my machine, and one was super old. After deleting both, deleting the remnant files in nodejs and npm-cache folders, and reinstalling fresh, I was then able to install the package.

So perhaps there's no problem with eleventy. Will close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant