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

Packager is required to live in node_modules of app #408

Closed
allenhartwig opened this issue Mar 28, 2015 · 5 comments
Closed

Packager is required to live in node_modules of app #408

allenhartwig opened this issue Mar 28, 2015 · 5 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@allenhartwig
Copy link

When working on a react-native fork, it is desirable to have your apps symlink to your repo directory rather than each app having their own instance of react-native in node_modules. Currently this is not supported by packager, as it assumes that the directory's physical location is within the projects node_module folder.

https://github.com/facebook/react-native/blob/master/packager/packager.js#L49-L55

@allenhartwig allenhartwig changed the title Packager is required to live in node_modules of app Packager is required to live in node_modules of app [packager] Mar 28, 2015
@allenhartwig allenhartwig changed the title Packager is required to live in node_modules of app [packager] Packager is required to live in node_modules of app Mar 28, 2015
@amasad
Copy link
Contributor

amasad commented Mar 28, 2015

Do you have any suggestion on what the best way to handle this?

@sahrens
Copy link
Contributor

sahrens commented Mar 28, 2015

Can you run the packager manually from your fork with --root <path/to/project>?

@allenhartwig
Copy link
Author

@sahrens starting packager.sh with --root does work. @amasad thoughts on starting packager with npm run start -- <project dir> rather than npm start and have package.sh relay the parameter as --root to packager.js? This way nothing is inferred and allows react-native's location to be completely independent of the app project.

@sahrens
Copy link
Contributor

sahrens commented Mar 28, 2015

It's preferred that each project has its own copy of the packager in node_modules for typical development so you don't have to worry about versioning between libs.

This doesn't really work with multiple React Native projects yet since the packager runs continuously on the same port, but there is discussion of adding a status endpoint so you could kill a currently running packager if it reports the wrong version via status and start the right one for that project automatically.

On Mar 28, 2015, at 3:49 PM, allenhartwig notifications@github.com wrote:

@sahrens starting packager.sh with --root does work. @amasad thoughts on starting packager with npm run start -- rather than npm start and have package.sh relay the parameter as --root to packager.js? This way nothing is inferred and allows react-native's location to be completely independent of the app project.


Reply to this email directly or view it on GitHub.

@allenhartwig
Copy link
Author

I've resolved this issue by creating a start.sh file in my app root, changing my package.json in my app root to utilize it for npm start and in start.sh I have the following:

THIS_DIR=$(dirname "$0")
node_modules/react-native/packager/packager.sh --root $THIS_DIR

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants