无法初始化 TypeORM 项目

编程入门 行业动态 更新时间:2024-10-22 03:01:28
本文介绍了无法初始化 TypeORM 项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

根据 TypeORM 文档,我正在尝试创建一个新的 TypeORM 项目并运行以下命令:

I'm trying to create a new TypeORM project and have run the following commands, according to the TypeORM documentation:

npm install typeorm -g typeorm init --name MyProject --database postgres

我收到此错误:

TypeError: Cannot set property EntityManager of #<Object> which has only a getter at Object.<anonymous> (~/.npm-global/lib/node_modules/typeorm/index.js:120:23) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (~/.npm-global/lib/node_modules/typeorm/commands/SchemaSyncCommand.js:4:15) at Module._compile (internal/modules/cjs/loader.js:778:30)

即使我只是尝试运行,我也会遇到同样的错误

I get the same error even if I just try to run

typeorm

推荐答案

添加

"resolutions": { "tslib": "1.11.2" }

到你的包 json,tslib 1.12 打破了 typeorm

to your package json, tslib 1.12 breaks typeorm

更多推荐

无法初始化 TypeORM 项目

本文发布于:2023-11-15 19:09:24,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1597184.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:初始化   项目   TypeORM

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!