首页 > 解决方案 > 当电子 ABI 与已安装节点不同时,无法生成 TypeORM 迁移

问题描述

目前从源代码构建 better-sqlite3 并且工作正常,但运行 typeorm migration:generate 最终失败,因为它使用具有不同 ABI 版本的本地节点。如果可能的话,我宁愿不必在迁移之前/之后重建。据我所知,没有节点发布正在使用电子 ABI,而且从查看电子和节点发布来看,这看起来也很难总是排队。

我尝试执行以下操作无济于事,尽管它有助于运行开玩笑测试。

yarn ELECTRON_RUN_AS_NODE=true ./node_modules/.bin/electron -r ts-node/register ./node_modules/.bin/typeorm -f path/to/ormconfig.ts migration:generate -n MigrationName

编辑:通过修改解决这个问题:node_modules/typeorm/cli.js

对于 args 处理,将 final 替换".argv;"".parse(process.argv.slice(2));"

标签: typescriptelectrontypeormbetter-sqlite3

解决方案


通过修改node_modules/typeorm/cli.jsFor the args processing replace the final解决了这个问题

.argv;

.parse(process.argv.slice(2));

推荐阅读