Submodule nvmrc update protocol from git to https by teodoropiccinni · Pull Request #3839 · nvm-sh/nvm · GitHub
Skip to content

Submodule nvmrc update protocol from git to https - #3839

Merged
ljharb merged 3 commits into
nvm-sh:masterfrom
teodoropiccinni:master
May 7, 2026
Merged

Submodule nvmrc update protocol from git to https#3839
ljharb merged 3 commits into
nvm-sh:masterfrom
teodoropiccinni:master

Conversation

@teodoropiccinni

Copy link
Copy Markdown
Contributor

Using Ansible to clone NVM to one of my server I am getting authentication error due to fatal: Could not read from remote repository.

The error is due to the fact that the submodule is currently set to use GIT protocol and require autentication. I just updated Submodule URL from GIT to HTTPS.

Error:

TASK [application_deps : Clone nvm v0.40.3] ************************************************
[ERROR]: Task failed: Module failed: Failed to init/update submodules: Submodule 'test/fixtures/nvmrc' (git@github.com:nvm-sh/nvmrc.git) registered for path 'test/fixtures/nvmrc'
Cloning into '/home/my-user/.nvm/test/fixtures/nvmrc'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:nvm-sh/nvmrc.git' into submodule path '/home/my-user/.nvm/test/fixtures/nvmrc' failed
Failed to clone 'test/fixtures/nvmrc'. Retry scheduled
Cloning into '/home/my-user/.nvm/test/fixtures/nvmrc'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

@ljharb ljharb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ssh is far superior to https; switching would break development use cases. i'm unclear on the problem

@ljharb

ljharb commented May 6, 2026

Copy link
Copy Markdown
Member

@teodoropiccinni
teodoropiccinni marked this pull request as draft May 6, 2026 18:57
@teodoropiccinni

Copy link
Copy Markdown
Contributor Author

why wouldn't your server have a github ssh key available?

No, I don't want to deploy SSH key on a production server if not cìnecessary.

@teodoropiccinni

Copy link
Copy Markdown
Contributor Author

ssh is far superior to https; switching would break development use cases. i'm unclear on the problem

Usually I have at least 2 branch in my repos: min/prod and develop. In the production I reference submodules using HTTPS (if repos ar public) in develop branch I use SSH to shorten development time.

@teodoropiccinni
teodoropiccinni marked this pull request as ready for review May 6, 2026 19:20
@teodoropiccinni

Copy link
Copy Markdown
Contributor Author

Fixed the indentation problem, do you think that we can merge the change?

@ljharb

ljharb commented May 6, 2026

Copy link
Copy Markdown
Member

That's a pretty atypical workflow ime.

I don't intend to merge this; it should be using ssh. The other thing though is that submodules aren't fetched by default - maybe your git config is doing this? Installing nvm shouldn't fetch the submodule, only development on it should.

@teodoropiccinni

teodoropiccinni commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

@teodoropiccinni
teodoropiccinni requested a review from ljharb May 7, 2026 11:48

@ljharb ljharb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, this seems like a great improvement. thanks!

@ljharb
ljharb merged commit f695512 into nvm-sh:master May 7, 2026
206 of 208 checks passed
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

Successfully merging this pull request may close these issues.

2 participants