Add alternative lsof command for killing a process running on port 8081.

Summary:
I was running RN 0.31 on ArchLinux (kernel 4.7), and "react-native start"
was refusing to run on the default (and sometimes required, as I have
noticed) port. I tried executing the suggested lsof command, but that did not
work. Somewhere I found the lsof command I include in this commit, and that
worked (it was a node.js process). So I'm including it, since I found it
helpful.
Closes https://github.com/facebook/react-native/pull/9402

Reviewed By: lacker

Differential Revision: D4144400

Pulled By: hramos

fbshipit-source-id: 6203549455555efc59b7bab0a3ec23957d80b956
This commit is contained in:
Joel Sánchez 2016-11-30 17:01:00 -08:00 committed by Facebook Github Bot
parent 48d3cd7d26
commit 921921237f
2 changed files with 3 additions and 3 deletions

View File

@ -16,7 +16,7 @@ The React Native packager runs on port 8081. If another process is already using
Run the following command on a Mac to find the id for the process that is listening on port 8081:
`$ sudo lsof -n -i4TCP:8081 | grep LISTEN`
`$ sudo lsof -i :8081`
Then run the following to terminate the process:

View File

@ -50,8 +50,8 @@ function server(argv, config, args) {
);
console.log('Most likely another process is already using this port');
console.log('Run the following command to find out which process:');
console.log('\n ', chalk.bold('lsof -n -i4TCP:' + args.port), '\n');
console.log('You can either shut down the other process:');
console.log('\n ', chalk.bold('lsof -i :' + args.port), '\n');
console.log('Then, you can either shut down the other process:');
console.log('\n ', chalk.bold('kill -9 <PID>'), '\n');
console.log('or run packager on different port.');
} else {