-
Notifications
You must be signed in to change notification settings - Fork 0
Run React Packager on different Port
Sanjeev Vaishya edited this page Sep 25, 2017
·
3 revisions
By default, port 8081 is used by react packager and most of the time this port is either used by other process like anti virus etc or other applications. To change the default port to something else, following these steps:
- Open new terminal, go to the react native project (authentication and run this command (in this case 8088 is our new port) -> $ cd /Users/svaishya75/onlinepractice/react-native/authentication
- $ run this command -> $react-native start --port=8088
- Open another terminal and Go to the react project folder
- update the default port (8081) entry with new port (lets say 8088) in the file node_modules/react-native/React/React.xcodeproj/project.pbxproj
- execute the command to run the app on ios simulator -> $ react-native run-ios
If you encounter an error such as npm WARN locking Error: EACCES while using the React Native CLI, try running the following: sudo chown -R $USER ~/.npm sudo chown -R $USER /usr/local/lib/node_modules
pending to update at later stage.