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
I get this error:
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
Add
"resolutions": {
"tslib": "1.11.2"
}
to your package json, tslib 1.12 breaks typeorm
The workaround that did it for me was this:
npm i [email protected] --save
and remove the ^
before the version in package.json of my project.
The open issue can be found here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With