react-native-cli

Is there an easy way to change the default port when i type in react-native run-android?

巧了我就是萌 提交于 2019-12-13 07:45:29
问题 My steps to change the default port: react-native start --port 9999. react-native run-android. change the port in the app. Is there an easy way? 回答1: You can also change permanent the port with change default server in react native node modules your_app\node_modules\react-native\local-cli\server\server.js and change the port 8081 to 9999 like this : .... module.exports = { name: 'start', func: server, description: 'starts the webserver', options: [{ command: '--port [number]', default: 8081,

Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release

安稳与你 提交于 2019-11-26 18:00:55
问题 react-native run-android terminates by leaving a message in message in android simulator . The message is as follows Unable to load script.Make sure you are either running a Metro server or that your bundle 'index.android.bundle' is packaged correctly for release. Am totally confused what's am doing wrong . Edit: Adding an error screenshot 回答1: You haven't started the bundler yet. Run npm start or react-native start in the root directly of your project before react-native run-android 回答2: