typescript - 当电子 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));"
解决方案
通过修改node_modules/typeorm/cli.js
For the args processing replace the final解决了这个问题
.argv;
和
.parse(process.argv.slice(2));
推荐阅读
- javascript - 在可重用的 Razor 类库中包含静态文件
- c# - ASP.NET API 和 nodejs 网站的 Windows 身份验证
- javascript - 使用显示块单击按钮时未显示 HTML 表格
- actionscript-3 - 获取点和影片剪辑之间的距离
- c++ - 如何在 MFC Dialog 应用程序中插入更多对话框?
- install4j - Install4J:安装期间未创建桌面图标
- sql-server - SQL WHERE IN 等效但使用 AND 而不是 OR
- javascript - 使用javascript为数据库中的每个项目创建一个链接到html页面的按钮
- git - 如何将 Git 存储库重置为其新克隆状态?
- r - R ggplot2用不等长向量绘制循环