Two solutions:
1. sudo mount /tmp -o remount,exec
2. export TMPDIR=$HOME/tmp before execute the failed command