cooderl / wewe-rss

🤗更优雅的微信公众号订阅方式,支持私有化部署、微信公众号RSS生成(基于微信读书)v2.x
MIT License
5.28k stars 909 forks source link

master分支,源码使用sqlite数据库,pnpm dev启动时报错 #146

Open gaoyajun01 opened 6 months ago

gaoyajun01 commented 6 months ago

master分支,源码使用sqlite数据库,pnpm dev启动时报错

# 使用Sqlite
DATABASE_URL="file:../data/wewe-rss.db"
DATABASE_TYPE="sqlite"

报错信息如下:

apps/server dev: PrismaClientInitializationError: error: Error validating datasource `db`: the URL must start with the protocol `mysql://`.
apps/server dev:   -->  schema.prisma:3
apps/server dev:    | 
apps/server dev:  2 |   provider = "mysql"
apps/server dev:  3 |   url      = env("DATABASE_URL")
apps/server dev:    | 
apps/server dev: Validation Error Count: 1
apps/server dev:     at r (/data/github/wewe-rss/node_modules/.pnpm/@prisma+client@5.10.1_prisma@5.10.2/node_modules/@prisma/client/runtime/library.js:113:2493)
apps/server dev:     at Proxy.onModuleInit (/data/github/wewe-rss/apps/server/src/prisma/prisma.service.ts:7:5)
apps/server dev:     at async Promise.all (index 0)
apps/server dev:     at callModuleInitHook (/data/github/wewe-rss/node_modules/.pnpm/@nestjs+core@10.3.3_@nestjs+common@10.3.3_@nestjs+platform-express@10.3.3_reflect-metadata@0.2.1_rxjs@7.8.1/node_modules/@nestjs/core/hooks/on-module-init.hook.js:43:5)                                                                                       
apps/server dev:     at NestApplication.callInitHook (/data/github/wewe-rss/node_modules/.pnpm/@nestjs+core@10.3.3_@nestjs+common@10.3.3_@nestjs+platform-express@10.3.3_reflect-metadata@0.2.1_rxjs@7.8.1/node_modules/@nestjs/core/nest-application-context.js:223:13)                                                                            
apps/server dev:     at NestApplication.init (/data/github/wewe-rss/node_modules/.pnpm/@nestjs+core@10.3.3_@nestjs+common@10.3.3_@nestjs+platform-express@10.3.3_reflect-metadata@0.2.1_rxjs@7.8.1/node_modules/@nestjs/core/nest-application.js:100:9)                                                                                             
apps/server dev:     at NestApplication.listen (/data/github/wewe-rss/node_modules/.pnpm/@nestjs+core@10.3.3_@nestjs+common@10.3.3_@nestjs+platform-express@10.3.3_reflect-metadata@0.2.1_rxjs@7.8.1/node_modules/@nestjs/core/nest-application.js:169:33)                                                                                          
apps/server dev:     at bootstrap (/data/github/wewe-rss/apps/server/src/main.ts:45:3)
OverflowCat commented 5 months ago
pnpm i
pnpm run -r build
pnpm deploy --filter=server --prod build
cd build
rm -r ./prisma
mv prisma-sqlite prisma
pnpm exec prisma generate
export DATABASE_URL=file:../data/wewe-rss.db
export DATABASE_TYPE=sqlite
pnpm exec prisma migrate deploy
node ./dist/main