title: how to create file symlink by using Nodejs on Windows?
body: <p>I'm making a tiny tool which is coding in Node.js and it would create file symlink on both Windows and OSX. However I get stuck at how to create symlink on Windows.</p>
  
  <p>First, I tried <code>fs.symlink</code> and <code>junction</code> option, but <code>junction</code> only works for directory on Windows.</p>
  
  <p>Secondly, by referring to <a href="https://stackoverflow.com/questions/18641864/git-bash-shell-fails-to-create-symbolic-links">Git Bash Shell fails to create symbolic links</a>, I tried to directly call <code>cmd &lt;&lt;&lt; mklink SOURCE TARGET</code> by using of <code>shelljs.exec</code>, it never returned, node console hung. </p>
  
  <p>Thirdly, I created a shell script named 'symlink.sh', invoked this script by child_process.spawn, I got <code>Error: spawn ENOENT</code>.</p>
  
  <p>Now I've no idea, how to solve it? Thanks</p>