Yarn: `https://yarnpkg.com/install.sh` fails when `TERM=vt100`

Created on 31 Oct 2016  路  5Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?

bug

What is the current behavior?

When curl -o- -L https://yarnpkg.com/install.sh | bash is run on a system with TERM set to vt100 the command will silently fail with exit code 1.

If the current behavior is a bug, please provide the steps to reproduce.

Run the following command and note that installation does not happen.
TERM=vt100 sh -c "curl -o- -L https://yarnpkg.com/install.sh | bash"

What is the expected behavior?

Yarn should be installed.

Please mention your node.js, yarn and operating system version.

Observed on CircleCI.
Ubuntu 14.04
Node 6.1.0
Yarn - Trying to install latest.

Other notes
This appears to be caused by the update to the installer script in:
https://github.com/yarnpkg/yarn/pull/1553

Since the tput command will return exit code 1 for a value that is set to false and bash will fail as soon as it encounters a non-0 exit code.

Most helpful comment

Hi! I work for CircleCI, I spent a bit of time troubleshooting this before I found this bug report.

We have a ton of folks running into this issue.

I can confirm that TERM=xterm works just fine https://circleci.com/gh/levlaz/circleci-testing/96

All 5 comments

My temporary solution has been to use the command: curl -o- -L https://yarnpkg.com/install.sh | TERM=xterm bash. Which at least allows the installer to run.

We hit the same problem on CircleCI. But we solved it by installing yarn from apt.

Hi! I work for CircleCI, I spent a bit of time troubleshooting this before I found this bug report.

We have a ton of folks running into this issue.

I can confirm that TERM=xterm works just fine https://circleci.com/gh/levlaz/circleci-testing/96

Ugh, terminals are terrible. Literally the worst. It probably fails when using VT100 because this thing doesn't know what colours are. I'm going to revert my diff and switch it to explicitly use /bin/bash. Broken colours are better than a broken script. Sorry for the breakage!

Should be fixed now, sorry for the breakage! Let me know if you see this again (feel free to ping me directly if you like).

Was this page helpful?
0 / 5 - 0 ratings