title: Bash - Compound if statement
body: <p>I am trying to install NPM dependencies, if the directory does not exist, but this shorthand is not working as is.    </p>
  
  <pre><code>    cd $(dirname "$0")
      if [[ ! -d "node_modules/babel-plugin-transform-runtime" ]] &amp;&amp; npm install babel-plugin-transform-runtime
      if [[ ! -d "node_modules/babel-preset-es2015" ]] &amp;&amp; npm install babel-preset-es2015
      if [[ ! -d "node_modules/babel-preset-es2016" ]] &amp;&amp; npm install babel-preset-es2016
      if [[ ! -d "node_modules/babel-polyfill" ]] &amp;&amp; npm install babel-polyfill
      if [[ ! -d "node_modules/babel-preset-stage-0" ]] &amp;&amp; npm install babel-preset-stage-0
      if [[ ! -d "node_modules/babel-preset-stage-1" ]] &amp;&amp; npm install babel-preset-stage-1
      if [[ ! -d "node_modules/babel-preset-stage-2" ]] &amp;&amp; npm install babel-preset-stage-2
      if [[ ! -d "node_modules/babel-preset-stage-3" ]] &amp;&amp; npm install babel-preset-stage-3
  </code></pre>
  
  <p>There is a syntax error - Bash expects a "then" - how can I do what I want to do?</p>