Skip to content

Commit 573fb68

Browse files
committed
Fix get process id
1 parent 4266122 commit 573fb68

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/react-dev-utils/getProcessForPort.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ function isProcessAReactApp(processCommand) {
2727
}
2828

2929
function getProcessIdOnPort(port) {
30-
return execSync(
31-
'lsof -i:' + port + ' -P -t -sTCP:LISTEN',
32-
execOptions
33-
).trim();
30+
let text = execSync('lsof -i:' + port + ' -P -t -sTCP:LISTEN', execOptions)
31+
.split('\n')[0]
32+
.trim();
33+
return text;
3434
}
3535

3636
function getPackageNameInDirectory(directory) {

0 commit comments

Comments
 (0)