Skip to content

Instantly share code, notes, and snippets.

@SteffenGivard
Created February 5, 2021 13:47
Show Gist options
  • Select an option

  • Save SteffenGivard/ac2b7b70acf7891e0a10346492d27bd9 to your computer and use it in GitHub Desktop.

Select an option

Save SteffenGivard/ac2b7b70acf7891e0a10346492d27bd9 to your computer and use it in GitHub Desktop.
How to install and use yarn on a Glitch project.

One-liner

Open a Glitch project, and paste the following into the terminal. When it's done press the reconnect button.

rm -rf /app/.yarn & touch .bash_profile && curl -o- -L https://yarnpkg.com/install.sh | bash && exit

Step by step

  1. Open a project or create a new one.

  2. On the bottom left, click Tools and then on Terminal.

  3. Make sure there's no .yarn file left over from previous attemps of setting up yarn.

    rm -rf /app/.yarn
  4. Create a .bash_profile file.

    touch .bash_profile
  5. Download and run the official installation script.

    curl -o- -L https://yarnpkg.com/install.sh | bash
  6. Reload the terminal:

    1. Type exit and hit Enter.

    2. Press the reconnect button.

  7. Confirm yarn is installed.

    yarn --version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment