Skip to content

getDependencyConfig/getRPNMConfig does not work when node modules are not linked inside of react-native project #15890

@joearasin

Description

@joearasin

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

(Write your answer here.)

Environment

  1. react-native -v: 0.48.1
  2. node -v: 8.4.0
  3. npm -v: 5.4.2
  4. yarn --version: 1.0.1

Then, specify:

  • Target Platform: iOS + Android
  • Development Operating System: macOS
  • Build tools:

Steps to Reproduce

  1. Create a yarn workspace project, with two workspaces: "common" and "native".
  2. Add some dependencies to common.
  3. Set "native" to depend on "common", and run yarn install.
  4. Update native/rn-cli.config.js to read:
const config = {
  getProjectRoots() {
    return [path.resolve(__dirname), path.resolve(__dirname, '..')];
  },
};
export default config.
  1. In the native project, run react-native link.

Expected Behavior

react-native link works properly.

Actual Behavior

react-native link throws "Cannot find module" errors

Reproducible Demo

https://github.com/joearasin/workspacesDemo

Metadata

Metadata

Assignees

No one assigned

    Labels

    StaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions