Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible without root package.json having expo/react/react-native? #2

Closed
ecoleman opened this issue Oct 22, 2018 · 14 comments
Closed
Assignees

Comments

@ecoleman
Copy link

It is possible to make this work without requiring the root installation of expo/react/react-native? I'd rather not repeat the dependencies in the root package.json, but it appears to cause issues with metro

@SimonM0
Copy link
Owner

SimonM0 commented Oct 22, 2018

Hey @ecoleman,

This is not possible at the moment as the metro bundler does not resolve symlinks. This is one of the biggest complaints of React Native see this issue

Regarding the rest of the packages in the root package.json at the very least react-native and expo need to be there. You can remove @expo/samples if you remove it from the project as that dependency came with the page that the expo-cli generated that includes some sample templates.

The rest of the devDependencies should be there as they are used by the monorepo to lint, test and run all the packages.

I hope this help!

@SimonM0 SimonM0 self-assigned this Oct 22, 2018
@SimonM0 SimonM0 closed this as completed Oct 22, 2018
@codebutler
Copy link

codebutler commented Nov 19, 2018

Is there any solution using nohoist? https://yarnpkg.com/blog/2018/02/15/nohoist/

I've tried a few things but couldn't get anything to work. Seems like we would need the ability to specify multiple paths in app.json nodeModulesPath.

@SimonM0
Copy link
Owner

SimonM0 commented Nov 19, 2018

@codebutler Try turning yarn workspaces off entirely and then using lerna bootstrap to do the symlinking of the packages. That should work.

@codebutler
Copy link

I tried this but it breaks all the yarn commands 😩
yarnpkg/yarn#3973

@Nantris
Copy link

Nantris commented Nov 25, 2018

I'm also very interested in this. Can anyone else mention the OS they're using just for reference? I'm using Windows, so I fully expect to never get this working, but I expect it's at least possible on Linux or Mac.

@SimonM0
Copy link
Owner

SimonM0 commented Nov 29, 2018

@codebutler You could always cd into the directory an run the yarn commands, that should work.

@Nantris
Copy link

Nantris commented Nov 29, 2018

@fried-chicken actually that's what I have to do, but unfortunately react-native is still required in the root package.json

Perhaps this can be fixed with the following. I've not tested it:

App.json

Change:

    "rnCliPath" : "../../node_modules/react-native/local-cli/cli.js",

to:

    "rnCliPath" : "./node_modules/react-native/local-cli/cli.js",

@Nantris
Copy link

Nantris commented Dec 4, 2018

I'm going to bet this commit to expo-cli will go a long way towards allowing this: expo/expo-cli@140a27f

@SimonM0
Copy link
Owner

SimonM0 commented Dec 4, 2018

Hey @slapbox That looks like it’ll fix the problem! Let’s reopen this issue and see if we can fix this issue. Will probably take a week or two as I don’t have my personal laptop with me this week. Unless one of you guys can raise a pr that fixes it!

@SimonM0 SimonM0 reopened this Dec 4, 2018
@SimonM0
Copy link
Owner

SimonM0 commented Jan 2, 2019

Made a few attempts to get this to work. Was unable to get it working properly. There appears to be issues with symlinks not being supported by watchman. This has been raised as an issue here Closing issue as it’s not currently possible to move the dependencies from the root package.jaon.

@SimonM0 SimonM0 closed this as completed Jan 2, 2019
@Nantris
Copy link

Nantris commented Jan 2, 2019

@fried-chicken thanks for taking a shot at it. Can you share the code you felt got you closest? Are you on Mac/Linux? I wonder if it might work on Windows. To my knowledge Watchman is not used on Windows unless you explicitly install it, although maybe I'm remembering incorrectly.

@SimonM0
Copy link
Owner

SimonM0 commented Jan 2, 2019

@slapbox Unfortunately I didn't commit any of the code, so I don't have any of it, but I would say none of it was close at all. I'm using Mac by the way.

@Nantris
Copy link

Nantris commented Jan 2, 2019

@fried-chicken thanks for the update anyway and thanks for all the work you've done!

If I get around to trying to make this work on Windows I'll post my findings.

@SimonM0
Copy link
Owner

SimonM0 commented Jan 2, 2019

@slapbox No worries. If you do manage to get it working, I would be more than happy to review the PR. It would be very interesting to see how the problem was tackled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants