aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/checker-before-init.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-07 12:04:06 +0200
committerChocobozzz <me@florianbigard.com>2019-08-07 12:07:59 +0200
commit51c3544718f751dbba4ece9aec39c53fab524c88 (patch)
treebf00c6b0f596642a1db6ac6d61229ae7aaa72bc3 /server/initializers/checker-before-init.ts
parent0763044f7d11a56dd5c5c424771dd83c76159de2 (diff)
downloadPeerTube-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/checker-before-init.ts')
-rw-r--r--server/initializers/checker-before-init.ts16
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 @@
1import * as config from 'config' 1import * as config from 'config'
2import { promisify0 } from '../helpers/core-utils' 2import { promisify0 } from '../helpers/core-utils'
3import { 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
113function 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
114export { 127export {
115 checkFFmpeg, 128 checkFFmpeg,
116 checkFFmpegEncoders, 129 checkFFmpegEncoders,
117 checkMissedConfig 130 checkMissedConfig,
131 checkNodeVersion
118} 132}