jooooock / wechat-article-exporter

在线批量导出微信公众号文章,支持内嵌的音视频导出,无需搭建任何环境,可100%还原文章样式,支持私有部署
https://wechat-article-exporter.deno.dev
MIT License
595 stars 63 forks source link

mac intel 使用报错:cannot find module deno-kv-napi.darwin-x64.node #12

Closed zh4n7wm closed 3 weeks ago

zh4n7wm commented 3 weeks ago

点击 下载 按钮,下载微信公众号文章时,报下面的错误

ERROR  [nuxt] [request error] [unhandled] [500] Cannot find module '..../wechat-article-exporter/node_modules/@deno/kv/node_modules/@deno/kv-darwin-x64/deno-kv-napi.darwin-x64.node'. Please verify that the package.json has a valid "main" entry
  at tryPackage (node:internal/modules/cjs/loader:445:19)
  at Function._findPath (node:internal/modules/cjs/loader:716:18)
  at Function._resolveFilename (node:internal/modules/cjs/loader:1131:27)
  at Function._load (node:internal/modules/cjs/loader:986:27)
  at Module.require (node:internal/modules/cjs/loader:1233:19)
  at require (node:internal/modules/helpers:179:18)
  at Object.<anonymous> (./node_modules/@deno/kv/esm/_napi_index.cjs:59:29)
  at Module._compile (node:internal/modules/cjs/loader:1358:14)
  at Object..js (node:internal/modules/cjs/loader:1416:10)
  at Module.load (node:internal/modules/cjs/loader:1208:32)
jooooock commented 3 weeks ago

把 yarn.lock 和 node_modules 删掉,重新安装依赖试试

zh4n7wm commented 3 weeks ago

把 yarn.lock 和 node_modules 删掉,重新安装依赖试试

重装还是会报相同的错误。


页面上点击下载之后,能成功下载,但页面会弹出下面的内容

image
jooooock commented 3 weeks ago

项目根目录下创建一个_data目录试试,我这边把这个目录删了之后会报下面的错误: image

这个目录是用于本地kv数据库,所以这个目录就没有包含到git里面,但是你上面报的错误应该是跟kv这个包有关系,跟目录没啥关系

zh4n7wm commented 3 weeks ago

还是会报错,我也不知道为啥了

感谢,先 close 吧

jooooock commented 3 weeks ago

你本地可以把下面这几行代码注释掉:

https://github.com/jooooock/wechat-article-exporter/blob/1e5815982aed1723871356d2e9259857e9b9e0f5/server/api/stat.post.ts#L56-L60

部署到deno deploy上面应该没这个问题,因为deno deploy自带kv数据库,不需要安装这个依赖

zh4n7wm commented 3 weeks ago

你本地可以把下面这几行代码注释掉:

https://github.com/jooooock/wechat-article-exporter/blob/1e5815982aed1723871356d2e9259857e9b9e0f5/server/api/stat.post.ts#L56-L60

部署到deno deploy上面应该没这个问题,因为deno deploy自带kv数据库,不需要安装这个依赖

本地运行时,注释掉就不会报错了,多谢