I am getting this error message during Install event in codedeploy: The deployment failed because a specified file already exists at this location: /var/www/api/app-name/.prettierrc
Here are my yaml and sh scripts
after_install.sh
#!/bin/bash
echo "Executing after_install.sh script..."
Navigate to app folder
cd /var/www/api/app-name
Ensure the latest code is checked out and dependencies are installed
git checkout origin/main
git pull origin main
npm install
npm run build
before_install.sh
#!/bin/bash
Install node.js and PM2 globally
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm -y
sudo npm install pm2 -g
=====================
start_server.sh
echo "Executing start_server.sh script..."
pm2 restart 0 --name "api-sound"
pm2 save
========================
appspec.yaml
version: 0.0
os: linux
files:
- source: /
destination: /var/www/api/app-name
overwrite: true
hooks:
BeforeInstall:
- location: scripts/before_install.sh
timeout: 300
runas: root
AfterInstall:
- location: scripts/after_install.sh
timeout: 300
runas: root
ApplicationStart:
- location: scripts/start_server.sh
timeout: 300
runas: root
any idea why i am encounterinf this during codedeploy?
![Enter image description here](https://cdn.statically.io/img/repost.aws/media/postImages/original/IMM7Pj-CYvRjaFOeaDJfBdhA)
will try thank you so much