Pranit-Harekar / fastlane-plugin-codepush

Fastlane plugin for App Center CodePush service 🚀
https://github.com/Pranit-Harekar/fastlane-plugin-codepush/wiki
MIT License
18 stars 3 forks source link

Unable to find or read "package.json" in the CWD. The "release-react" command must be executed in a React Native project folder. #5

Closed spsaucier-bakkt closed 3 years ago

spsaucier-bakkt commented 3 years ago

When running:

    codepush_release_react(
      app_name: "MyOrg/myapp"
    )

from the myapp/ios (or android) directory,

I'm getting this error:

Error: Command 'codepush release-react -a [MyOrg]/[myapp] -t *' failed with exception "Unable to find or read "package.json" in the CWD. The "release-react" command must be executed in a React Native project folder."

In myapp/package.json I do have a name field specified, though it doesn't exactly match the app name in App Center (surely it doesn't need to), since we are building multiple apps from the same repo for different environments.

I've tried adding execution_dir_path: "../", to try to run it from the project root directory, but that results in the same error.

Should this command work without specifying the execution_dir_path when called from within the ios or android folder?

spsaucier-bakkt commented 3 years ago

Actually, adding execution_dir_path: "../" did fix the issue. This is likely something most projects will encounter.