Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cli-tools/src/handlePortUnavailable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const handlePortUnavailable = async (
port = nextPort;
} else {
packager = false;
logChangePortInstructions(port);
logChangePortInstructions();
}
}

Expand Down
13 changes: 6 additions & 7 deletions packages/cli-tools/src/port.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import {prompt} from './prompt';
import logger from './logger';
import chalk from 'chalk';

export const askForPortChange = async (port: number, nextPort: number) => {
logger.info(
`Metro is already running on port ${chalk.bold(port)} in another project.`,
);
logger.info(`Another process is running on port ${port}.`);
return await prompt({
name: 'change',
type: 'select',
Expand All @@ -18,11 +15,13 @@ export const askForPortChange = async (port: number, nextPort: number) => {
};

export const logAlreadyRunningBundler = (port: number) => {
logger.info(`Metro Bundler is already for this project on port ${port}.`);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Fixes typo!

logger.info(
`A dev server is already running for this project on port ${port}.`,
);
};

export const logChangePortInstructions = (port: number) => {
export const logChangePortInstructions = () => {
logger.info(
`Please close the other packager running on port ${port}, or select another port with "--port".`,
'Please terminate this process and try again, or use another port with "--port".',
);
};