fatal: remote error: The unauthenticated git protocol on port 9418 is no longer support

created at 06-05-2022 views: 12

background

Because of working from home, after downloading the code from the remote clone, I found that using npm install has been failing.

error

fatal: remote error: The unauthenticated git protocol on port 9418 is no longer support

At first I thought it was because of the node version problem. I used to toss myself to death because of the version problem. After node --version, the version is found to be OK.

If it's not a version problem, what's causing the problem?

Check the log carefully and find a link to github, click it, and it prompts the problem caused by the upgrade of github's security mechanism.

Then the corresponding solution given by the official:

Resolve unauthenticated git protocol error on port 9418 is no longer supported.

The first solution is to use https://github.com instead of git://github.com and the problem will be solved.

The second solution is to find the git:// in the url in the project's package.json file and replace it with github: i.e. git://github.com/… Replace with github:.

solution

option 1

Replace git: with https:

git config --global url."https://".insteadOf git://

option 2

Modify git://github.com/

Find the git:// url in the package.json file and replace it with github:

like this:

git://github.com/…

replace with

github:......

Basically the problem is solved, if there is a package-lock.json file in the project, you need to modify the package-lock.json file

created at:06-05-2022
edited at: 06-05-2022: