diff options
author | Chocobozzz <me@florianbigard.com> | 2019-08-07 12:04:06 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2019-08-07 12:07:59 +0200 |
commit | 51c3544718f751dbba4ece9aec39c53fab524c88 (patch) | |
tree | bf00c6b0f596642a1db6ac6d61229ae7aaa72bc3 /server/initializers | |
parent | 0763044f7d11a56dd5c5c424771dd83c76159de2 (diff) | |
download | PeerTube-51c3544718f751dbba4ece9aec39c53fab524c88.tar.gz PeerTube-51c3544718f751dbba4ece9aec39c53fab524c88.tar.zst PeerTube-51c3544718f751dbba4ece9aec39c53fab524c88.zip |
Deprecate Node 8
The support ends on December 2019: https://github.com/nodejs/Release#release-schedule
Diffstat (limited to 'server/initializers')
-rw-r--r-- | server/initializers/checker-before-init.ts | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/server/initializers/checker-before-init.ts b/server/initializers/checker-before-init.ts index c94bca2f8..55bc820f5 100644 --- a/server/initializers/checker-before-init.ts +++ b/server/initializers/checker-before-init.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | import * as config from 'config' | 1 | import * as config from 'config' |
2 | import { promisify0 } from '../helpers/core-utils' | 2 | import { promisify0 } from '../helpers/core-utils' |
3 | import { logger } from '../helpers/logger' | ||
3 | 4 | ||
4 | // ONLY USE CORE MODULES IN THIS FILE! | 5 | // ONLY USE CORE MODULES IN THIS FILE! |
5 | 6 | ||
@@ -109,10 +110,23 @@ async function checkFFmpegEncoders (): Promise<Map<string, boolean>> { | |||
109 | return supportedOptionalEncoders | 110 | return supportedOptionalEncoders |
110 | } | 111 | } |
111 | 112 | ||
113 | function checkNodeVersion () { | ||
114 | const v = process.version | ||
115 | const majorString = v.split('.')[0].replace('v', '') | ||
116 | const major = parseInt(majorString, 10) | ||
117 | |||
118 | logger.debug('Checking NodeJS version %s.', v) | ||
119 | |||
120 | if (major < 10) { | ||
121 | logger.warn('Your NodeJS version %s is deprecated. Please use Node 10.', v) | ||
122 | } | ||
123 | } | ||
124 | |||
112 | // --------------------------------------------------------------------------- | 125 | // --------------------------------------------------------------------------- |
113 | 126 | ||
114 | export { | 127 | export { |
115 | checkFFmpeg, | 128 | checkFFmpeg, |
116 | checkFFmpegEncoders, | 129 | checkFFmpegEncoders, |
117 | checkMissedConfig | 130 | checkMissedConfig, |
131 | checkNodeVersion | ||
118 | } | 132 | } |