Creating Symbolic Links in Windows 10

I noticed that Windows 10 command line includes a lot of utilities that you had to install manually before or run cygwin. Utilities like ssh, ssh-keygen, scp, and even the command ls. Quite nice for someone like me who works in both platforms.

Symbolic Links was something I use heavily in a recent project as there are multiple mini apps that require common node_modules and bower_components. While my bower_components directory doesn't require a lot of space (around 11-12MB) the node_modules folder is around 200MB. Quite hefty, especially if you have multiple copies.

Enter symbolic links. In linux, it's quite simple you type:

ln -s sourcePath targetPath

reference

It's easy because the ln command can resolve a lot of the common paths and shortcuts you use in Linux.

In Windows 10 you need to use the mklink command in the regular Command Prompt Window. mklink is not available in PowerShell for some reason.

mklink \J fullTargetPath fullSourcePath

Note the reversed order, and the fact that you can't use shortcuts at all, you must be very specific.

reference on mklink