Skip to content

Commit 853956b

Browse files
committed
fix: move Node.js version warning to consistent look
1 parent 4d20d31 commit 853956b

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

src/checks/nodejs-version.ts

+6-17
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,23 @@
1-
import boxen from 'boxen';
2-
import chalk from 'chalk';
31
import { stripIndent } from 'common-tags';
4-
import size from 'window-size';
5-
import wrapAnsi from 'wrap-ansi';
2+
import { warningMessage } from '../printers/utils';
63

74
const SERVERLESS_NODE_JS_VERSION = '8.10';
85

96
export function printVersionWarning(
107
nodeVersion: string,
118
expectedVersion: string
129
): void {
13-
const msg = chalk`
14-
{underline.bold {yellow WARNING!} {bold Different Node.js version}}
15-
10+
const title = 'Different Node.js Version Found';
11+
const msg = stripIndent`
1612
You are currently running Node.js ${nodeVersion} on this local machine. The production environment for Twilio Serverless is currently on ${expectedVersion}.
1713
1814
When you deploy to Twilio Serverless, you may encounter differences between local development and production.
1915
2016
For a more accurate local development experience, please switch your Node.js version.
2117
A tool like nvm (https://github.com/creationix/nvm) can help.
22-
`;
23-
const wrappedMsg = wrapAnsi(msg, size.width - 20);
24-
console.error(
25-
boxen(stripIndent(wrappedMsg), {
26-
padding: 1,
27-
margin: 1,
28-
borderStyle: 'double',
29-
float: 'center',
30-
})
31-
);
18+
`;
19+
20+
console.warn(warningMessage(title, msg));
3221
}
3322

3423
export default function checkNodejsVersion() {

0 commit comments

Comments
 (0)