[Bug?]: /tmp noexec
Self-service
- [ ] I'd be willing to implement a fix
Describe the bug
This is probably not a bug but I think it's good to have a ticket here for people that run into this issue in the future.
If you're trying to run a script and getting "permission denied" back, the reason could be that yarn is trying to run something from /tmp and your /tmp directory is mounted with noexec.
The workaround I've found:
mkdir ~/.yarn/tmp
# now run the thing that wasn't working before, e.g.
TMPDIR=~/.yarn/tmp yarn depcheck
If it works you can update your .zshrc/.bashrc/whatever with an alias
alias yarn="TMPDIR=~/.yarn/tmp yarn"
Hopefully this helps someone.
To reproduce
This link to sherlock is broken, 404...
to reproduce
yarn add --dev depcheck
package.json
"scripts": {
"depcheck": "depcheck . --ignores=depcheck,ts-node,'eslint-*','@types/*'",
}
yarn depcheck
Returns "permission denied" if /tmp is mounted with noexec.
Environment
System:
OS: Linux 6.4 Artix Linux
CPU: (20) x64 13th Gen Intel(R) Core(TM) i9-13900H
Binaries:
Node: 18.16.1 - ~/.yarn/tmp/xfs-a1a545f3/node
Yarn: 3.6.3 - ~/.yarn/tmp/xfs-a1a545f3/yarn
npm: 9.5.1 - ~/n/bin/npm
npmPackages:
jest: ^29.6.4 => 29.6.4
Additional context
Perhaps this could be mentioned in some docs somewhere? It's not trivial for an unexperienced dev to troubleshoot this.
I spent half a day trying to figure out what my issue was. Ended up being this. Yarn should def warn when this is the case