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

安装依赖报错 #11497

Open
taoyi3 opened this issue Jan 13, 2025 · 7 comments
Open

安装依赖报错 #11497

taoyi3 opened this issue Jan 13, 2025 · 7 comments

Comments

@taoyi3
Copy link

taoyi3 commented Jan 13, 2025

描述问题:

npm i报错,不知道如何解决呢

截图或视频:

image

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的?
    npm

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
    3.6.3

  3. 粘贴有问题的完整 amis schema 代码:


4. 操作步骤
请简单描述一下复现的操作步骤...
@ranwawa
Copy link
Contributor

ranwawa commented Jan 15, 2025

问题分析

这是由于在安装依赖的时候,其中有一个依赖是通过github下载的。ssh://[email protected]/xqq/webworkify-webpack.git

由于github被墙,所以你本地下载不了

问题解决

  1. 翻墙

  2. 如果之前可以,现在不可以。那就把之前的package-lock文件拿回来安装

  3. 如果没有之前的package-lock文件,在package.json中添加如下代码,因为mpegts自动升级导致的问题,强制将这个依赖的版本指定到正常版本即可

{
  "overrides": {
    "amis": {
      "mpegts.js": "1.6.10"
    }
  }
}

@cxhcmc
Copy link

cxhcmc commented Jan 18, 2025

pnpm 下,{ "overrides": { "amis": { "mpegts": "1.6.10" } } }
应该如何配置?

@kingsley1653
Copy link

package.json配置了
{ ... "overrides": { "amis": { "mpegts": "1.6.10" } } }
问题还是存在。。。错误日志如下:
npm error code 128 npm error An unknown git error occurred npm error command git --no-replace-objects ls-remote ssh://[email protected]/xqq/webworkify-webpack.git npm error ssh: connect to host github.com port 22: Connection refused npm error fatal: Could not read from remote repository. npm error npm error Please make sure you have the correct access rights npm error and the repository exists.

@ranwawa
Copy link
Contributor

ranwawa commented Jan 21, 2025

pnpm 下,{ "overrides": { "amis": { "mpegts": "1.6.10" } } } 应该如何配置?

建议不要用pnpm,官方推荐是使用npm 并且是legacy安装模式

@kingsley1653
Copy link

kingsley1653 commented Jan 21, 2025 via email

@ranwawa
Copy link
Contributor

ranwawa commented Jan 21, 2025

package.json配置了 { ... "overrides": { "amis": { "mpegts": "1.6.10" } } } 问题还是存在。。。错误日志如下: npm error code 128 npm error An unknown git error occurred npm error command git --no-replace-objects ls-remote ssh://[email protected]/xqq/webworkify-webpack.git npm error ssh: connect to host github.com port 22: Connection refused npm error fatal: Could not read from remote repository. npm error npm error Please make sure you have the correct access rights npm error and the repository exists.

不好意思,包名搞错了

{
  "overrides": {
    "amis": {
      "mpegts.js": "1.6.10"
    }
  }
}

@taoyi3
Copy link
Author

taoyi3 commented Jan 23, 2025

我是这样解决的, "overrides": {
"mpegts.js": "1.7.3"
},
"resolutions": {
"mpegts.js": "1.7.3"
}都加到package.json,dependencies里面指定 "mpegts.js": "1.7.3",部署的时候要执行: # 删除现有的 lock 文件和模块
- rm -f package-lock.json
- rm -rf node_modules
,这样就可以安装成功了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants