Skip to content

rnc-cli ENOENT error - RNC_CLI_BINARY_PATH has incorrect path in monorepos #691

@marklawlor

Description

@marklawlor

Description

#685 changed how the @react-native-community/cli was invoked and now it incorrectly assumes that the binary will be located within process.cwd()/node_modules/bin. In a monorepo structure, it is unlikely the binary is in this location due to package hoisting.

Previously, bob used npx to invoke the binary (which respects monorepo structure), but after the PR the path to the binary is hardcoded as

  const RNC_CLI_BINARY_PATH = path.resolve(
    process.cwd(), // We are always expected to run in the library
    'node_modules',
    '.bin',
    rncCliBinaryName
  );

Packages

  • create-react-native-library
  • react-native-builder-bob

Selected options

Link to repro

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions