How do I install Windows 10 on an external drive? I'd like to use an external USB3 drive for Windows 10, but I don't know how to install it. Booting the Windows installer errors out saying that it can't be installed on an external device.
You'll need to install Windows in a virtual machine and then copy the virtual disk to the target disk. The free trial of Parallels Desktop worked for me.

Once you get your Windows installed in the virtual machine, go into Parallels' settings and shrink the virtual disk as much as possible (I shrunk mine to 32GB but you could probably go with even less). Once that's done attach a bootable Linux ISO (Ubuntu) or something like CloneZilla to the VM and boot the VM from it that instead of Windows.

Once the VM is booted, pass-through your target USB drive to the VM, and then clone the (virtual) Windows disk to the external drive from within the VM. On an Ubuntu 17.04, I used the following terminal commands to do it:

sudo dd if=/dev/sda of=/dev/sdb bs=4M


/dev/sda being the virtual Windows disk, /dev/sdb being the target drive attached to the VM.

Once that's done you can power down the VM, then reboot your Mac and hold the Option/Alt key while rebooting until you see a boot menu asking which device you want to boot from. Select "EFI boot" and Windows should be loading from the target drive.

Once you are in Windows it's a good idea to check for updates, check your privacy settings to make sure everything is correct and most of the privacy-invading stuff is disabled, and use Disk Management to enlarge your disk partition to take the entire space of the target drive (a bit by bit copy of the virtual disk means the partition on the target drive is just as small despite the drive being larger).

Finally you might want to install the Boot Camp drivers to make sure all hardware is recognized by Windows. To do so reboot back in macOS and run the Boot Camp assistant to create a Windows bootable USB from your ISO image. We don't actually care about the Windows part anymore since it's now installed, but the assistant will also put drivers on that USB and this is what we want. Once that's finished reboot back onto your target drive, then insert the Boot Camp USB and you should see a "Boot Camp" folder there, with a "setup.exe" inside. Run that and you should be good to go.