Home > other >  How to configure Metro for running React Native packager/bundler on different server port?
How to configure Metro for running React Native packager/bundler on different server port?

Time:10-19

I configured Metro to run React Native packager/bundler on a different port as 8081 is being used by McAfee service and I can't kill this process on my Mac.

I changed the default port to 8088 in Xcode script/files etc. but there seems to be some issue with my code in metro.config.js file... it doesn't work:

const { getDefaultConfig } = require('expo/metro-config');
const portConfig = getDefaultConfig(__dirname);

portConfig.server.port = 8088;
module.exports = portConfig;

Thank you!

CodePudding user response:

Sorry! My code is correct... it wasn't working yesterday because of some other issue. Once i fixed that, this config is working fine :)

Before customizing Metro file, I had to manually start Metro Packager(from the terminal) whenever I was launching the React Native App from Xcode. However once I configured the Metro, the Packager/bundler is starting automatically when I run the App from Xcode... so all good now!

  • Related