title: Babel build program is breaking permission of NPM bin script
body: <p>I have NPM package with a <code>bin</code> property linking to a script, e.g.</p>
  
  <p><code>/foo/package.json</code></p>
  
  <pre class="lang-json prettyprint-override"><code>{
      "name": "foo",
      "bin": "./dist/index.js"
  }
  </code></pre>
  
  <p><code>/foo/src/index.js</code></p>
  
  <pre class="lang-js prettyprint-override"><code>#! /usr/bin/env node
  
  console.log('Hello, World!');
  </code></pre>
  
  <p>I use <code>npm link</code> to create a globally-installed symbolic link of <code>foo</code> package.</p>
  
  <p>Then I use:</p>
  
  <pre class="lang-bash prettyprint-override"><code>node ./node_modules/.bin/babel\
      --watch ./src\
      --out-dir ./dist
  </code></pre>
  
  <p>Next, I have a <code>bar</code> package.</p>
  
  <p><code>package.json</code></p>
  
  <pre class="lang-json prettyprint-override"><code>{
      "name": "bar",
      "scripts": {
          "test-foo": "foo"
      }
  }
  </code></pre>
  
  <p>I use <code>npm link foo</code> to create a symlink from the local <code>node_modules</code> folder to the global symlink.</p>
  
  <p>Then I attempt to execute <code>npm run test-foo</code>. I expect to get "Hello, World!" message. Instead, I get the following error message:</p>
  
  <pre><code>npm run test-foo
  
  &gt; bar@0.0.0 test-foo /bar
  &gt; foo
  
  sh: /Users/gajus/bar/node_modules/.bin/foo: Permission denied
  
  npm ERR! Darwin 15.2.0
  npm ERR! argv "/Users/gajus/.nvm/versions/node/v5.3.0/bin/node" "/Users/gajus/.nvm/versions/node/v5.3.0/bin/npm" "run" "test-foo"
  npm ERR! node v5.3.0
  npm ERR! npm  v3.5.2
  npm ERR! code ELIFECYCLE
  npm ERR! bar@3.7.3 test-foo: `foo`
  npm ERR! Exit status 126
  npm ERR!
  npm ERR! Failed at the table@3.7.3 test-foo script 'foo'.
  npm ERR! Make sure you have the latest version of node.js and npm installed.
  npm ERR! If you do, this is most likely a problem with the table package,
  npm ERR! not with npm itself.
  npm ERR! Tell the author that this fails on your system:
  npm ERR!     foo
  npm ERR! You can get information on how to open an issue for this project with:
  npm ERR!     npm bugs table
  npm ERR! Or if that isn't available, you can get their info via:
  npm ERR!     npm owner ls table
  npm ERR! There is likely additional logging output above.
  
  npm ERR! Please include the following file with any support request:
  npm ERR!     /Users/gajus/Documents/dev/gajus/table/npm-debug.log
  </code></pre>
  
  <p>Which is basically complaining that current user does not have permission to execute <code>/Users/gajus/bar/node_modules/.bin/foo</code> file.</p>
  
  <p>I can solve this with: </p>
  
  <pre class="lang-bash prettyprint-override"><code>chmod +x /Users/gajus/bar/node_modules/.bin/foo
  </code></pre>
  
  <p>However, I do not understand what is the reason that this file does not have permission to be executed in the first place. I am running <code>babel</code> program as the same user.</p>
  
  <p>It appears to be an issue with the way NPM setups a global symlink (it sets it once. When <code>babel --watch</code> creates a new file, it no longer persists).</p>
  
  <p>What is the solution to have <code>+x</code> persist with <code>npm link</code>?</p>