vue-element-admin icon indicating copy to clipboard operation
vue-element-admin copied to clipboard

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

Open jlinw opened this issue 2 years ago • 22 comments

npm install npm ERR! code 128 npm ERR! An unknown git error occurred npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/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:

jlinw avatar Nov 01 '21 09:11 jlinw

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

shawnhuangshao avatar Nov 03 '21 05:11 shawnhuangshao

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

chuichui9527 avatar Nov 03 '21 12:11 chuichui9527

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

cundi avatar Nov 04 '21 08:11 cundi

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

mybirthfather avatar Nov 05 '21 03:11 mybirthfather

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

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

mybirthfather avatar Nov 05 '21 03:11 mybirthfather

我碰到过405

hikaru102 avatar Nov 05 '21 07:11 hikaru102

方法一: 挂代理,目前最有效 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://[email protected]/nhn/raphael.git git config --global url."https://github.com/adobe-webplatform/eve.git".insteadOf ssh://[email protected]/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 多执行几次,目前能找到的解决方法

chnljx avatar Nov 08 '21 07:11 chnljx

方法一: 挂代理,目前最有效 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

cundi avatar Nov 11 '21 01:11 cundi

单独下载 npm install --save raphael

aalj avatar Nov 19 '21 09:11 aalj

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

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

zenghnn avatar Dec 06 '21 10:12 zenghnn

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

方法四最有用 0V0

1ET avatar Dec 16 '21 10:12 1ET

已收到!

BlackChainLife avatar Dec 16 '21 10:12 BlackChainLife

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

zqhjc avatar Dec 31 '21 08:12 zqhjc

已收到!

BlackChainLife avatar Dec 31 '21 08:12 BlackChainLife

`

.gitconfig

https://github.com/PanJiaChen/vue-element-admin/issues/3859

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

benmo1602 avatar May 23 '22 07:05 benmo1602

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

哥,thanks~

Isaymore avatar Jul 04 '22 02:07 Isaymore

都不行,郁闷

GIS90 avatar Jul 18 '22 01:07 GIS90

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

august0715 avatar Aug 26 '22 06:08 august0715

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

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

1.这个类库下载是通过ssh://[email protected]/nhn/raphael.git 命令下载的

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

image

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

geekxingyun avatar Jan 03 '23 07:01 geekxingyun

试验了如下方法:

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

碰到新问题:

npm WARN deprecated [email protected]: use String.prototype.padStart()
[   ...............] \ fetchMetadata: sill resolveWithNewModule [email protected] 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

试验了如下方法:

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

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

pengyuwei avatar Jan 27 '23 01:01 pengyuwei

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

cagegit avatar Apr 20 '23 01:04 cagegit

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

zhengbaby666 avatar Nov 14 '23 00:11 zhengbaby666