Closed NamesMT closed 4 days ago
I can't reproduce this on my end. Can you use GitHub Actions or something to demonstrate it?
Hello @privatenumber,
Here is a oneline reproduction using docker run: docker run -it --rm namesmt/images-alpine:node-dev zsh -c "cd home && nlx giget gh:namesmt/repro-tsx repro-tsx && cd repro-tsx && ni && ls && ls tsx-0 && zsh"
Sorry but a screenshot doesn't help. And I don't use Docker.
I need a reproduction env for me to debug and test fixes in. GitHub Actions or any kind of CI would work best.
Hello @privatenumber, idk why but for github's default runners I could not reproduce it, but does indeed exists because I could reproduce the issue on my work machine which uses plain Ubuntu,
I have also do more tests and it is indeed reproducible on various docker images: ubuntu
, node
/node:slim
, alpine
.
I have also able to reproduce it on my company Gitlab CI with node:alpine
image.
For your convenience, I have setup a repo in which I was able to use Github Actions to reproduce it (using docker container action): https://github.com/NamesMT/repro-tsx-action You could simply fork it and push commits/PR to test.
Thanks a lot.
I appreciate it, thanks @NamesMT
I haven't confirmed this, but I believe this is actually https://github.com/pnpm/pnpm/issues/7330
tsx creates a cache directory in os.tmpdir()
which implies pnpm in Alpine is returning the current working directory in the env variables.
Will take a closer look later on.
If it's rooted in pnpm, then it's not a tsx bug. And I would rather not patch bugs from other tools via tsx.
This is for the same reasons I would relay any Node bugs we get to https://github.com/nodejs/node. Encouraging fixes to be made in the right places maximizes benefit to the community.
Can you verify this is what's causing it by running pnpm with unsafe-perm
? https://github.com/pnpm/npm-lifecycle/blob/1e0f149176877f906968a01087cf63290652ccbc/index.js#L100
If so, try opening a PR there.
Yes I can verify that running pnpm with unsafe-perm
, the issue is not present, thanks a lot for finding the root cause.
Don't have time to open a PR yet but I'll do it when I do and no one has created one specific to it.
Closing as it's a bug in pnpm rather than tsx
Acknowledgements
Minimal reproduction URL
https://stackblitz.com/github/namesmt/repro-tsx
Problem & expected behavior (under 200 words)
Alternative github repo because stackblitz could not load for me, idk if it's just me: https://github.com/NamesMT/repro-tsx
Simply run![image](https://github.com/privatenumber/tsx/assets/23612546/f19ca78f-da0b-4378-8d1f-4ff72125268b)
pnpm install
, an unexpected file is created along with the foldertsx-0
It does not happen with normal
npm
Bugs are expected to be fixed by those affected by it
Compensating engineering work will speed up resolution and support the project