aws / aws-codedeploy-agent

Host Agent for AWS CodeDeploy
https://aws.amazon.com/codedeploy
Apache License 2.0
329 stars 187 forks source link

CodeDeploy error on ApplicationStart #218

Closed mohit61 closed 2 years ago

mohit61 commented 5 years ago

Event Log

Error code ScriptFailed Script name scripts/npm-start.sh Message Script at specified location: scripts/npm-start.sh run as user root failed with exit code 254

This is npm-start.sh file

#!/bin/bash
cd /var/api
npm start

This is the error


[stderr]npm ERR! Linux 4.15.0-1041-aws
[stderr]npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start"
[stderr]npm ERR! node v8.10.0
[stderr]npm ERR! npm  v3.5.2
[stderr]npm ERR! path /var/api/package.json
[stderr]npm ERR! code ENOENT
[stderr]npm ERR! errno -2
[stderr]npm ERR! syscall open
[stderr]
[stderr]npm ERR! enoent ENOENT: no such file or directory, open '/var/api/package.json'
[stderr]npm ERR! enoent ENOENT: no such file or directory, open '/var/api/package.json'
[stderr]npm ERR! enoent This is most likely not a problem with npm itself
[stderr]npm ERR! enoent and is related to npm not being able to find a file.
[stderr]npm ERR! enoent 
[stderr]
[stderr]npm ERR! Please include the following file with any support request:
[stderr]npm ERR!     /var/api/npm-debug.log```
adrianblynch commented 5 years ago

I have the same problem.

Any ideas about what's causing this?

mwjones-aws commented 2 years ago

Can you confirm /var/api/package.json is present? Is package.json part of the revision/bundle you're deploying?