-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
How to change the port 8081? #10715
Comments
There are two files needed to be modified about port 8081:
|
What about |
You'll need to start the packager on a different port using the |
I modified all of the files listed above,the packager could be started,but when I ran the command "react-native run-android",it didn't still worked.
|
@codepandy I replaced EVERY 8081 I could find in my project with 8088 which seemed to work. |
Got the same problem here on Genymotion, android studio emulator and real devices. Isn't there any elegant alternative rather than need to change every files to another port other than 8081? |
our server component bind on port 8081, running the react-native client on the same machine is cumbersome... |
Changed EVERY instance of port from |
Duplicate of #9145 |
Summary: Thanks for submitting a PR! Please read these instructions carefully: - [x ] Explain the **motivation** for making this change. - [x ] Provide a **test plan** demonstrating that the code is solid. - [x ] Match the **code formatting** of the rest of the codebase. - [x ] Target the `master` branch, NOT a "stable" branch. The section on changing ports is missing a key step for folks wishing to run on device What existing problem does the pull request solve? Changing packager port to something other than 8081 also requires the react native xcode project file to be updated in order to be able to build and run on device. The section on changing ports currently does not address this. See #10715 (comment). Documentation update, no tests required. A good test plan has the exact commands you ran and their output, provides screenshots or videos if the pull request changes UI or updates the website. See [What is a Test Plan?][1] to learn more. If you have added code that should be tested, add tests. Sign the [CLA][2], if you haven't already. Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it. Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged. For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines. [1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9 [2]: https://code.facebook.com/cla [3]: https://travis-ci.org/facebook/react-native [4]: http://circleci.com/gh/facebook/react-native [5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests Closes #14293 Differential Revision: D5647393 Pulled By: hramos fbshipit-source-id: 040c3edea7d25c0efe560d5df30e86e1f26355bc
@codepandy @liuxh0 I just ran into the same problem, thanks McAfee 👎
|
same problem here. |
Same problem , trying it on windows |
npm start -- --port=8080 worked for me |
Two Steps which worked for me:
|
These are the files where I had to tweak port number to make it work on a different port
Afterwards, running simple |
Two Steps which worked for me: node_modules/react-native/local-cli/server/server.js |
For debugging(Windows) , open the react native debugger - Then press Ctrl +Shift + J , this will open Developer Tools where you can use tabs like Console, Source etc. |
Hi All, 1>> Change the port in "\node_modules\react-native\local-cli\server\server.js" from default:
to
if the port is blocked or issued to some other application. Now it will start loading the changes you make in your application. Enjoy coding now :) |
8081端口被占用,我是用这种方式实现的
|
Hi,
Because of the port is used by McAfee in my company,it's difficult to develop every time.
whether can the port be changed to another one?
how to do?
The text was updated successfully, but these errors were encountered: