Skip to content

Commit

Permalink
feat(cli): 当 node 版本过低时报错
Browse files Browse the repository at this point in the history
  • Loading branch information
yuche committed Jul 4, 2018
1 parent c8a3c22 commit c35a91f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions packages/taro-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"postcss": "^6.0.22",
"postcss-pxtransform": "0.0.67",
"resolve": "^1.6.0",
"semver": "^5.5.0",
"shelljs": "^0.8.1",
"through2": "^2.0.3",
"vinyl": "^2.1.0",
Expand Down
5 changes: 5 additions & 0 deletions packages/taro-cli/src/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const path = require('path')
const fs = require('fs-extra')
const chalk = require('chalk')
const inquirer = require('inquirer')
const semver = require('semver')

const Creator = require('./creator')

Expand All @@ -15,6 +16,10 @@ const { SOURCE_DIR } = require('./config')
class Project extends Creator {
constructor (options) {
super()
const unSupportedVer = semver.lt(process.version, 'v7.6.0')
if (unSupportedVer) {
throw new Error('Node.js 版本过低,推荐升级 Node.js 至 v8.0.0+')
}
this.rootPath = this._rootPath
this.conf = Object.assign({
projectName: null,
Expand Down
12 changes: 6 additions & 6 deletions packages/taro-cli/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@
version "0.7.0"
resolved "https://registry.npmjs.org/@sindresorhus/is/-/is-0.7.0.tgz#9a06f4f137ee84d7df0460c1fdb1135ffa6c50fd"

"@tarojs/transformer-wx@0.0.55":
version "0.0.55"
resolved "https://registry.npmjs.org/@tarojs/transformer-wx/-/transformer-wx-0.0.55.tgz#67c810305b7cc85821094314ca23626d3a7efcdc"
"@tarojs/transformer-wx@0.0.67":
version "0.0.67"
resolved "https://registry.npmjs.org/@tarojs/transformer-wx/-/transformer-wx-0.0.67.tgz#58fff7145f3d56139ee99e0ca44148b58ac24f58"
dependencies:
"@babel/code-frame" "^7.0.0-beta.44"
"@babel/core" "^7.0.0-beta.42"
Expand Down Expand Up @@ -1976,9 +1976,9 @@ postcss-pxtorem@^4.0.1:
object-assign "^4.1.0"
postcss "^5.2.10"

postcss-pxtransform@0.0.55:
version "0.0.55"
resolved "https://registry.npmjs.org/postcss-pxtransform/-/postcss-pxtransform-0.0.55.tgz#66f5244622c9bcfbb6049ca9b2865b4a88ea55c8"
postcss-pxtransform@0.0.67:
version "0.0.67"
resolved "https://registry.npmjs.org/postcss-pxtransform/-/postcss-pxtransform-0.0.67.tgz#dc687d2b224d8bf525198e7cda81f576d122d411"
dependencies:
postcss "^6.0.16"
postcss-pxtorem "^4.0.1"
Expand Down

0 comments on commit c35a91f

Please sign in to comment.