I am using react native android and having face issues to deploy the app on an android device. When I run
react-native start, it won\'t start dev server
I know it is late but FYI, there is also another way where you can change your port permanently.
Go to your_app\node_modules\react-native\local-cli\server\server.js and change the port 8081 to 8088
which will be something like this
...
module.exports = {
name: 'start',
func: server,
description: 'starts the webserver',
options: [{
command: '--port [number]',
default: 8088,
parse: (val) => Number(val),
}
...
UPDATE TESTED ON RN 0.57:
1. If you are using custom metro config
const config = {
...
server: {
port: 8088,
}
...
};
2. And if you are not then,
Go to your_app\node_modules\react-native\local-cli\util\Config.js
const Config = {
...
server: {
port: process.env.RCT_METRO_PORT || 8088 //changed from 8081
}
...
}