title: appspec.yml failed to call scripts
body: <p>I am trying to setup CI using AWS CodeDeploy and CircleCI. Right now I am stuck at the step where AWS CodeDeploy should copy stuff into EC2 and run scripts. But somehow CircleCI tells me something is wrong. Does anyone know what might be happening?  Thanks.  </p>
  
  <p>the appspec.yml is:</p>
  
  <pre><code>version: 0.0
  os: linux
  files:
    - source: /
      destination: /home/ubuntu
  hooks:
    BeforeInstall:
      - location: scripts/setup.sh
        timeout: 3800
        runas: root
    ApplicationStart:
      - location: scripts/start.sh
        timeout: 3800
        runas: root
  </code></pre>
  
  <p>and setup.sh is: </p>
  
  <pre><code>#!/bin/bash
  sudo apt-get install nodejs npm
  npm install
  </code></pre>
  
  <p>in the above code I also tried only <code>apt-get install nodejs npm</code> but it's still nor working. </p>
  
  <p>the error message in <code>/var/log/aws/codedeploy-agent/codedeploy-agent.log</code> is as follows: </p>
  
  <pre><code>2015-10-22 08:02:54 ERROR [codedeploy-agent(1314)]: InstanceAgent::Plugins::CodeDeployPlugin::CommandPoller: Error during 
   perform: InstanceAgent::Plugins::CodeDeployPlugin::ScriptError - Script at specified location:
  ./scripts/setup.sh run as user root failed with exit code 127 - /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/hook_executor.rb:150:in `execute_script'
  /opt/codedeploy-agent/lib/instance_agent/plugins/codedeploy/hook_executor.rb:107:in `block (2 levels) in execute'
  ......
  </code></pre>