Getting Yew to work with Rust on ‘Bash on Ubuntu on Windows’ in Windows 10

Raymond Siu
Apr 8, 2018 · 2 min read
Image for post
Image for post
“Sun rays shining through trees in a foggy forest.” by Filip Varga on Unsplash

Purpose

Yew is a new web framework written in Rust that takes concepts from React JS and Elm. It takes the two web libraries I love and combines them with the new language I love — Rust. I wrote this article because I haven’t found a lot of documentation online on how to get the Yew examples running, and I’m sure there will be people that will run into the same problems I did. I wrote this in hopes that it helps someone out there.

Here is the big kicker. Make sure you have the Ubuntu 16.04 LTS installed! You can check by opening Bash on Ubuntu on Windows and typing:

You should see:

If you don’t have Ubuntu 16.04 installed, then open a Windows command prompt and type:

This will uninstall whatever version you currently have, and will download and install Ubuntu 16.04 LTS. Hooray!

Now re-open Bash on Ubuntu on Windows and then install Rustup and Rust:

Install Oracle Java 8 and clang:

Install Emscripten (taken from Emscripten’s official site):

Verify your Emscripten installation:

Install cargo web:

Clone the Yew repo from the good ol’ Github:

Navigate to one of the examples you’d like to run, and then execute:

If anyone has issues with these instructions, I can try to help, but I don’t want to turn this into a “Stack Overflow”-overflow…

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store