This is a brief guide to getting a Windows environment set up for Carbon development. We'll be using the Windows Subsystem for Linux with an Ubuntu install 👐🏽.
Note: if you have native Windows versions of Yarn, NVM/Node, Python and the like
Windows automatically imports your paths into your WSL by default
(running echo $PATH
can confirm this), this can be a source of weird bugs when
WSL is attempting to run Windows versions of -- for example Python -- instead of
your WSL version. 🤦🏽♂️ That interop is fine (using Windows executables via WSL),
but can be unexpected.
- Install Ubuntu 18.04 LTS via the Microsoft Store
- Run the Ubuntu application -- which should look like a familiar bash terminal (the remainder of the guide will happen here 👍🏽)
- Setup a user name and password when prompted
- Update your Ubuntu repositories
sudo apt-get update
- Install the build-essential package
sudo apt install build-essential
- Install nvm via their install and update script found here
- Source your newly NVMed .bashrc
source ~/.bashrc
- Install latest LTS Node release
nvm install --lts
- Install Python 2
sudo apt install python2-minimal
- Install Yarn by running:
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn
- Enable
chmod
/chown
functionality (allowing you togit clone...
from WSL)sudo umount /mnt/c
sudo mount -t drvfs C: /mnt/c -o metadata
- Increase Linux OS limits to avoid errors in build process (limited by WSL by
default).
- https://muhammadtriwibowo.medium.com/set-permanently-ulimit-n-open-files-in-ubuntu-4d61064429a
ulimit -l 65536
-> Increases the maximum amount of locked memory available to OSulimit -n 1048576
-> Increases the maximum amount of files that can be in an open state
- Change directories into your projects folder
cd /mnt/c/Users/{username}/projects
(Only an example, use whatever you'd like) - Clone our repo
git clone https://github.com/carbon-design-system/carbon.git
- In the root folder of your freshly cloned repo install and build
yarn install
yarn build
Unfortunately, there is a known bug on Windows GitHub Desktop with pre-commit
hooks. The current workaround is to use a --no-verify
tag on git CLI.
To commit all staged changes:
git commit -am "commit message" --no-verify
To commit specific files:
git add file_name
git commit -m "commit message" --no-verify