当前位置: 首页 > 工具软件 > git.js > 使用案例 >

npm报错git.EXE ls-remote -h -t https://github.com/nhn/raphael.git

谷梁涵忍
2023-12-01


一、问题描述

npm 执行报错 git.EXE ls-remote -h -t https://github.com/nhn/raphael.git :

npm ERR! Error while executing:
npm ERR! d:\Program Files\Git\cmd\git.EXE ls-remote -h -t https://github.com/nhn/raphael.git
npm ERR!
npm ERR! fatal: remote error:
npm ERR!   The unauthenticated git protocol on port 9418 is no longer supported.
npm ERR! Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.
npm ERR!
npm ERR! exited with error code: 128

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\Program Files\nodejs\node_cache\_logs\2022-05-11T03_24_25_356Z-debug.log

二、解决方法

1.方法1

使用 https 替换 git :

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

2.方法2

如果方法1不行,可能是依赖包没下载全,按 npm install无法生成node_modules的解决方法 进行处理。

3.方法3

终极大法,将能够编译正确的同事电脑上的 node_modules 包拷贝过来吧!

 类似资料: