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] Development server not auto starting from Xcode #3135

Closed
pangers opened this issue Sep 30, 2015 · 10 comments
Closed

[Packager] Development server not auto starting from Xcode #3135

pangers opened this issue Sep 30, 2015 · 10 comments
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@pangers
Copy link

pangers commented Sep 30, 2015

I am trying to run the react native application through Xcode, however, the development server does not seem to get started automatically. I must always type npm start at the project root before running in Xcode. Where am I going wrong?

@antsmartian
Copy link

What version of xcode are you running?

@astreet astreet added the Platform: iOS iOS applications. label Sep 30, 2015
@pangers
Copy link
Author

pangers commented Sep 30, 2015

I am running Xcode 7

@brentvatne
Copy link
Collaborator

Hi @pangers! That's unfortunate. Did you try rebooting your machine? And close any existing terminal window with the dev server running?

@brentvatne brentvatne changed the title Development server not auto starting [Packager] Development server not auto starting from Xcode Sep 30, 2015
@jaygarcia
Copy link
Contributor

This could be a path issue somewhere. Is NPM installed properly? is it globally accessible?

@pangers
Copy link
Author

pangers commented Sep 30, 2015

@brentvatne Yep just restarted my machine, with no terminal windows open and I must still run npm start manually before building with Xcode.

@jaygarcia I seem to be able to type npm -v in any directory of my computer so I assume it is globally accesible

@grabbou
Copy link
Contributor

grabbou commented Oct 1, 2015

There's been also an issue regarding that but I can't find it. Are you running xcodeproj or xcworkspace with Pods? I am on XCode 7 and everything works properly. With Pods, it looks like you may need to copy one script that's responsible for packager to your build settings.

Please check if you have it under Build Phases -> Run Script.

screen shot 2015-10-01 at 10 28 39

@pangers
Copy link
Author

pangers commented Oct 1, 2015

I discovered the problem. One of the directories that the project folder was in had a space in its name. As soon as I removed the space, hitting command + R automatically ran the npm server!

@kostiakoval
Copy link
Contributor

Yes I had faced the same issue. It's because of space in the directory name

"Test One" - Doesn't work
"Test_One" - Works

"The file /Users/konstantin/Desktop/Test One/TestMe/node_modules/react-native/React/One/TestMe/node_modules/react-native/packager/launchPackager.command does not exist.
Can't start packager automatically
"

Steps to Reproduce:

mkdir Test\ One
cd Test\ One
react-native init TestMe

Open Xcode project and hit build

@S-YOU
Copy link

S-YOU commented Oct 11, 2015

May be add double quotes to this line

shellScript = "if nc -w 5 -z localhost 8081 ; then\n if ! curl -s \"http://localhost:8081/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port 8081 already in use, packager is either not running or not running correctly\"\n exit 2\n fi\nelse\n open $SRCROOT/../packager/launchPackager.command || echo \"Can't start packager automatically\"\nfi";

"$SRCROOT/../packager/launchPackager.command"

@mroswald
Copy link
Contributor

+1

@ghost ghost closed this as completed in bd3cb3a Dec 12, 2015
@facebook facebook locked as resolved and limited conversation to collaborators Jul 21, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 21, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants