React Native 上运行eas-build-pre-install脚本时EAS生成权限被拒绝错误

x759pob2  于 6个月前  发布在  React
关注(0)|答案(1)|浏览(70)

当EAS Build在构建过程中尝试运行我的eas-build-pre-install脚本时,我遇到了“Permission denied”错误。我有一个专门为Android构建安装pnpm的脚本。scripts/eas-pre-install中的脚本内容是:

#!/bin/bash

if [[ "$EAS_BUILD_PLATFORM" == "android" ]]; then
  npm install -g [email protected]
  pnpm --version
fi

字符串
在我的package.json中,我定义了eas-build-pre-install脚本如下:

"scripts": {
  "eas-build-pre-install": "./scripts/eas-pre-install"
}

#!/bin/bash

if [[ "$EAS_BUILD_PLATFORM" == "android" ]]; then
  npm install -g [email protected]
  pnpm --version
fi

Script 'eas-build-pre-install' is present in package.json, running it...

> [email protected] eas-build-pre-install /home/expo/workingdir/build

> ./scripts/eas-pre-install

sh: 1: ./scripts/eas-pre-install: Permission denied

ELIFECYCLE  Command failed with exit code 126.

WARN   Local package.json exists, but node_modules missing, did you mean to install?

pnpm run eas-build-pre-install exited with non-zero code: 1

7z5jn7bk

7z5jn7bk1#

确保脚本预安装具有执行权限。您可以使用以下命令授予执行权限:

chmod +x pre-install

字符串
运行此命令后,再次尝试执行脚本。

相关问题