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 报错,怎么搞? 哪里问题? #3859

Open
jlinw opened this issue Nov 1, 2021 · 22 comments
Open

npm install 报错,怎么搞? 哪里问题? #3859

jlinw opened this issue Nov 1, 2021 · 22 comments

Comments

@jlinw
Copy link

jlinw commented Nov 1, 2021

npm install
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/nhn/raphael.git
npm ERR! command-line line 0: unsupported option "accept-new".
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! A complete log of this run can be found in:

Other relevant information(格外信息)

  • Your OS:
  • Node.js version:
  • vue-element-admin version:
@shawnhuangshao
Copy link

跟你一样得问题, 换yarn安装试试

@chuichui9527
Copy link

chuichui9527 commented Nov 3, 2021

开一个加速器试试 比如 ~~~

@cundi
Copy link

cundi commented Nov 4, 2021

同问,npm config用了socks5代理也不行

@mybirthfather
Copy link

git config --global url."https://".insteadOf ssh://git@
使用这个命令 将ssh 下载变成https就行了 加油 小伙伴们

@mybirthfather
Copy link

同问,npm config用了socks5代理也不行

配置的是 ssh 再怎么用代理 你也下载不下来 ssh的 要配置密钥的 换成 https 就行了

@hikaru102
Copy link

我碰到过405

@chnljx
Copy link

chnljx commented Nov 8, 2021

方法一:
挂代理,目前最有效
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080

方法二:
1、在项目目录下创建文件:.npmrc
内容:
sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
registry=https://registry.npm.taobao.org
2、命令行
git config --global url."https://github.com/nhn/raphael.git".insteadOf ssh://git@github.com/nhn/raphael.git
git config --global url."https://github.com/adobe-webplatform/eve.git".insteadOf ssh://git@github.com/adobe-webplatform/eve.git

方法三:
在项目目录下执行命令:
git --no-replace-objects ls-remote https://github.com.cnpmjs.org/nhn/raphael.git
git --no-replace-objects ls-remote https://github.com.cnpmjs.org/adobe-webplatform/eve.git

方法四:
换个时间,随缘

npm install 多执行几次,目前能找到的解决方法

@cundi
Copy link

cundi commented Nov 11, 2021

方法一: 挂代理,目前最有效 git config --global http.proxy http://127.0.0.1:1080 git config --global https.proxy https://127.0.0.1:1080

方法二: 在项目目录下创建文件:.npmrc 内容: sass_binary_site=https://npm.taobao.org/mirrors/node-sass/ registry=https://registry.npm.taobao.org

方法三: 在项目目录下执行命令: git --no-replace-objects ls-remote https://github.com.cnpmjs.org/nhn/raphael.git git --no-replace-objects ls-remote https://github.com.cnpmjs.org/adobe-webplatform/eve.git

方法四: 换个时间,随缘

npm install 多执行几次,目前能找到的解决方法

方法三works for me

@aalj
Copy link

aalj commented Nov 19, 2021

单独下载
npm install --save raphael

@zenghnn
Copy link

zenghnn commented Dec 6, 2021

git config --global url."https://".insteadOf ssh://git@ 使用这个命令 将ssh 下载变成https就行了 加油 小伙伴们

谢谢啊,终于解决,蛋疼死了

@1ET
Copy link

1ET commented Dec 16, 2021

git --no-replace-objects ls-remote https://github.com.cnpmjs.org/nhn/raphael.git

方法四最有用 0V0

@BlackChainLife
Copy link

BlackChainLife commented Dec 16, 2021 via email

@zqhjc
Copy link

zqhjc commented Dec 31, 2021

我在centos上也遇到问题,服务器在香港,不存在翻墙问题,所以排除代理问题,ssh key 也创建了,确认能用,最后发现原来是npm版本问题,新装的默认是8.x 降级到6 就可以了
npm install npm@6.14.10 -g

@BlackChainLife
Copy link

BlackChainLife commented Dec 31, 2021 via email

@benmo1602
Copy link

benmo1602 commented May 23, 2022

`

.gitconfig

#3859

[url "https://github.com/nhn/raphael.git"]
insteadOf = ssh://git@github.com/nhn/raphael.git
[url "https://github.com/adobe-webplatform/eve.git"]
insteadOf = git://github.com/adobe-webplatform/eve.git
`

@Isaymore
Copy link

Isaymore commented Jul 4, 2022

git config --global url."https://".insteadOf ssh://git@ 使用这个命令 将ssh 下载变成https就行了 加油 小伙伴们

哥,thanks~

@GIS90
Copy link

GIS90 commented Jul 18, 2022

都不行,郁闷

@august0715
Copy link

垃圾实现,这种动态下载依赖的方式,完全绕过了npm源,公司的npm私服或者像淘宝这种镜像站点都不起作用了。

@geekxingyun
Copy link

刚开始错误怀疑是node JS或 NPM 包版本不兼容引起的,实际上并不是,也不是什么网络问题引起。

实际上发现很坑的一个根本原因是:

1.这个类库下载是通过ssh://git@github.com/nhn/raphael.git 命令下载的

2 也就是说,你必须处于登录状态或配置了访问github 的ssh key 才可以访问成功,

image

你们可以试试,如果未登录状态是压根看不到这个ssh 下载方式选项的

@pengyuwei
Copy link

pengyuwei commented Jan 27, 2023

试验了如下方法:

  • 降低npm版本到17、16,无效❌
  • npm install --save raphael,有效✅

碰到新问题:

npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
[   ...............] \ fetchMetadata: sill resolveWithNewModule raw-loader@0.5.1 checking
npm ERR! code 128
npm ERR! Command failed: git clone --depth=1 -q -b fix/ie-cannot-input-korean https://github.com/sohee-lee7/Squire.git /home/ff/.npm/_cacache/tmp/git-clone-54a648c7

试验了如下方法:

  • git config --global url."https://github".insteadOf github: ❌无效
  • hosts: 199.232.68.133 raw.githubusercontent.com ❌无效

后来百般打听,听说vue-element-admin必须使用node 12版本。

@cagegit
Copy link

cagegit commented Apr 20, 2023

亲测使用pnpm可以成功下载依赖,如果下载过程遇到git ssh 的问题请安装依赖前先执行以下命令:
git config --global url."https://github.com/nhn/raphael.git".insteadOf ssh://git@github.com/nhn/raphael.git
git config --global url."https://github.com/adobe-webplatform/eve.git".insteadOf ssh://git@github.com/adobe-webplatform/eve.git

@zhengbaby666
Copy link

亲测 npm config set proxy http://yourproxy:8080 成功

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