idootop / mi-gpt

🏠 将小爱音箱接入 ChatGPT 和豆包,改造成你的专属语音助手。
MIT License
7.18k stars 662 forks source link

关于在Replit上运行的问题 #174

Closed homo11451419 closed 3 weeks ago

homo11451419 commented 3 weeks ago

1.docker死活运行不了。失败。 2.尝试用node运行。 依赖安装过程:

~/mi-gpt$ npm install mi-gpt
 Environment updated. Reloading shell...
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'tsup@8.2.4',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.18.1', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'tsx@4.17.0',
npm WARN EBADENGINE   required: { node: '>=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.18.1', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'esbuild@0.23.1',
npm WARN EBADENGINE   required: { node: '>=18' },
npm WARN EBADENGINE   current: { node: 'v16.18.1', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'postcss-load-config@6.0.1',
npm WARN EBADENGINE   required: { node: '>= 18' },
npm WARN EBADENGINE   current: { node: 'v16.18.1', npm: '8.19.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'rollup@4.21.0',
npm WARN EBADENGINE   required: { node: '>=18.0.0', npm: '>=8.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.18.1', npm: '8.19.2' }
npm WARN EBADENGINE }

added 193 packages, and audited 194 packages in 31s

29 packages are looking for funding
  run `npm fund` for details

4 moderate severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.
 Environment updated. Reloading shell...
~/mi-gpt$ nvm install node
22 is already installed.
Now using node 22
 Environment rebuilding in the background...
~/mi-gpt$ nvm use node
Nothing to do
 Environment updated. Reloading shell...
~/mi-gpt$ npm audit fix --force
npm warn using --force Recommended protections disabled.
npm warn audit Updating tsup to 3.7.0, which is a SemVer major change.

added 19 packages, removed 41 packages, changed 3 packages, and audited 172 packages in 6s

22 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

(注:使用run.ts运行。

import config from "./.migpt.js";
import { MiGPT } from "./dist/index.cjs";

async function main() {
  const client = MiGPT.create(config);
  await client.start();
}

main();

) 开始运行!

--> npm install

> mi-gpt@4.1.0 postinstall
> npx -y prisma migrate dev --name hello

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": SQLite database "app.db" at "file:app.db"

SQLite database app.db created at file:app.db

Applying migration `20240227161545_init`

The following migration(s) have been applied:

migrations/
  └─ 20240227161545_init/
    └─ migration.sql

Your database is now in sync with your schema.

✔ Generated Prisma Client (v5.18.0) to ./node_modules/@prisma/client in 331ms

up to date, audited 172 packages in 5s

22 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

开始报错:

node:internal/modules/cjs/loader:1189
  throw err;
  ^

Error: Cannot find module '/home/runner/mi-gpt/run'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1186:15)
    at Module._load (node:internal/modules/cjs/loader:1012:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:158:12)
    at node:internal/main/run_main_module:30:49 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v22.2.0

在Windows11上运行正常。 Replit的Linux版本:

~/mi-gpt$ uname -a
Linux 66a40a07bb67 6.5.0-1025-gcp #27~22.04.1-Ubuntu SMP Tue Jul 16 23:03:39 UTC 2024 x86_64 GNU/Linux
~/mi-gpt$ lsb_release -r
Release:    20.04

省流:Ubuntu 20.04

idootop commented 3 weeks ago

docker 死活运行不起来

  1. docker 容器运行的方式,不可能存在运行不起来的情况,因为容器内部环境已经测试过
  2. 只可能没有你的设备对应的 arch 的 docker image ,或者搞错 arch
  3. 或者你哪里参数配置/挂载的不正确,or 镜像拉不下来

node 方式报错

  1. 我不晓得你是用何种方式运行的,以及为何使用 run.ts 为入口,建议参考 example 分之下的示例代码
  2. 报错信息是找不到你指定的 run.ts 入口文件
  3. 建议排查的方向:replit 运行时是否要求先将整个项目和依赖运行环境打包

PS:本人未使用过 Replit,亦不清楚其项目内部运行机制,如有问题请自行解决。

或者在你的回复/issue里提供完整的报错环境/运行命令和日志信息,我才能协助排查。

你上面的描述缺少:

  1. docker运行失败的启动方式和log
  2. node的运行命令和你的项目结构,以及完整报错log