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

Installation from npm still fails #94

Closed
feritarou opened this issue Nov 28, 2021 · 6 comments
Closed

Installation from npm still fails #94

feritarou opened this issue Nov 28, 2021 · 6 comments

Comments

@feritarou
Copy link

feritarou commented Nov 28, 2021

Continuing the discussion in the closed Issue #15, nuxt-mail fails to install its dependencies for me in production CI, but in my case it is not related to a missing git binary.
This is what I get:

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://[email protected]/dword-design/endent.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 am using Nuxt.js 2.15.8 and deploying to a self-hosted Dokku environment.

@dword-design
Copy link
Owner

dword-design commented Nov 28, 2021

@feritarou I did some research on this and I think the problem is that the CI system does not now the github.com host. Locally, you usually get a prompt where you can accept the host and then it is added to the ~/.ssh/known_hosts file. On CI systems, you are not asked the prompt. Theoretically, you can add the host to the known_hosts file and then it should work (see also this answer on Stack Overflow). Which CI system are you using?

The question now is, if it makes more sense to adjust the CI process, or if you should avoid fork dependencies in package.json in general. I do not have a clear opinion on this and I'm open to suggestions/resources.

References:

@davidsandoz
Copy link

I got almost the same error. Maybe it's even the same, but just expressed differently because of a different npm version.

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://[email protected]/dword-design/endent.git
npm ERR! 
npm ERR! Warning: Permanently added the RSA host key for IP address '140.82.113.3' to the list of known hosts.
npm ERR! [email protected]: 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

This happens within a GitHub action.

A few workarounds are provided in actions/setup-node#214

An easy one being to replace git+ssh:// with git+https:// in package-lock.json.

@dword-design
Copy link
Owner

@davidsandoz Thanks for the link! I could reproduce the issue and commented on it in the linked issue. I think the only reasonable fix is to replace the forks with scoped packages. It's far from ideal because you cannot make out which scoped package comes from a fork and which is really a scoped production package, but yeah that's how it is.

Let me know if that makes sense, then I can do the replacements, no big deal.

@davidsandoz
Copy link

@dword-design I agree with you regarding the reasonable fix. The workaround I applied works, but it doesn't seem like a proper solution to have to update this manually in the package-lock file.

@dword-design
Copy link
Owner

@davidsandoz Should work after npm update. Feel free to reopen if there are issues.

@davidsandoz
Copy link

Thanks, @dword-design! Works well now 👍

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

No branches or pull requests

3 participants