我正在部署我的Angular应用程序,但遇到以下错误:
sh: 1: ./heroku.build.sh: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 126
npm ERR! [email protected] 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
)
型
如何修复此错误?
我删除了node_modules
,并删除了heroku.build.sh
,但它仍然不工作。
2条答案
按热度按时间41ik7eoe1#
chmod +x heroku.build.sh在一个正确的目录将解决这个问题。
zu0ti5jz2#
字符串