Issue
I am deploying my Angular application and getting this error:
sh: 1: ./heroku.build.sh: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! givebrite@1.0.2 heroku-postbuild: `./heroku.build.sh
package.json
"heroku-postbuild": "./heroku.build.sh"
heroku.build.sh
#!/usr/bin/env bash
usage() {
echo "OVERVIEW: Build apps according to BUILD_ENV value. Meant to be used for Heroku deployment"
exit
}
if [ "$1" = '-h' ] || [ "$1" = '--help' ]; then
usage
fi
(
if [ "$BUILD_ENV" ]; then
ng build $BUILD_ENV --configuration $ENVIRONMENT && ng run $BUILD_ENV:server:$ENVIRONMENT
else
echo "Error: no build config for BUILD_ENV value '$BUILD_ENV'"
exit 1
fi
)
How to fix this error?
I removed node_modules
and deleted the heroku.build.sh
but still it did not work.
Solution
For windows this will work
In a terminal, I ran git add --chmod=+x heroku.build.sh
Then git commit -m "Updated permission"
Finally git push
Answered By - Abhinav Akhil
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.