Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typeorm-ts-node-esm doesn't work on linux environments #8855

Closed
Spiderbyte12 opened this issue Apr 6, 2022 · 2 comments
Closed

typeorm-ts-node-esm doesn't work on linux environments #8855

Spiderbyte12 opened this issue Apr 6, 2022 · 2 comments

Comments

@Spiderbyte12
Copy link

Issue Description

typeorm-ts-node-esm doesn't work on linux environments, due to env shebang with multiple arguments

Expected Behavior

Running npx typeorm-ts-node-esm should work on linux.

Actual Behavior

npx typeorm-ts-node-esm returns:

'node --loader ts-node/esm --no-warnings' no such file exists

This is a result of the shebang being parsed incorrectly, a known issue with env on almost all linux distros.
Running into this issue trying to run migrations from inside a docker container (on a CI pipeline)

Steps to Reproduce

  1. On linux, install typeorm
  2. Run npx typeorm init.
  3. Run npx typeorm-ts-node-esm

My Environment

Dependency Version
Operating System Linux Alpine
Node.js version 16.14.2
Typescript version 4.4.4
TypeORM version 0.3.4

Are you willing to resolve this issue by submitting a Pull Request?

  • ✅ Yes, I have the time, and I know how to start.
  • ✖️ Yes, I have the time, but I don't know how to start. I would need guidance.
  • ✖️ No, I don’t have the time, but I can support (using donations) development.
  • ✖️ No, I don’t have the time and I’m okay to wait for the community / maintainers to resolve this issue.

Fixing this has the potential issue of breaking compatibility in other places. It's possible that the best way to approach this is to but an alternate path in to work around the shebang, and still correctly set the environment variables.

@AlexMesser
Copy link
Collaborator

fixed in #8821 and released in 0.3.5. Please update your TypeORM to the latest version and reopen this issue if the error persists.

@Spiderbyte12
Copy link
Author

Oh! I had only just installed and hadn't realised there was already a patch!
Thanks heaps, nice work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants