File tree 1 file changed +2
-9
lines changed
1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -4,17 +4,10 @@ var chalk = require('chalk')
4
4
var packageConfig = require ( '../package.json' )
5
5
6
6
module . exports = function ( done ) {
7
- // Parse version number from strings such as 'v4.2.0' or `>=4.0.0'
8
- function parseVersionNumber ( versionString ) {
9
- return parseFloat ( versionString . replace ( / [ ^ \d \. ] / g, '' ) )
10
- }
11
-
12
7
// Ensure minimum supported node version is used
13
- var minNodeVersion = parseVersionNumber ( packageConfig . engines . node )
14
- var currentNodeVersion = parseVersionNumber ( process . version )
15
- if ( minNodeVersion > currentNodeVersion ) {
8
+ if ( ! semver . satisfies ( process . version , packageConfig . engines . node ) ) {
16
9
return console . log ( chalk . red (
17
- ' You must upgrade node to >=' + minNodeVersion + '.x to use vue-cli'
10
+ ' You must upgrade node to >=' + packageConfig . engines . node + '.x to use vue-cli'
18
11
) )
19
12
}
20
13
You can’t perform that action at this time.
0 commit comments