fix(@vant/cli): failed to run lint command

This commit is contained in:
chenjiahan 2021-09-07 15:23:51 +08:00
parent 5a395c27c1
commit 2b7ad935ab
4 changed files with 9 additions and 8 deletions

View File

@ -15,7 +15,7 @@
"*.{vue,css,less}": "stylelint --fix" "*.{vue,css,less}": "stylelint --fix"
}, },
"devDependencies": { "devDependencies": {
"@vant/cli": "^4.0.0-beta.3", "@vant/cli": "^4.0.0-beta.4",
"@vue/compiler-sfc": "3.2.8", "@vue/compiler-sfc": "3.2.8",
"vue": "3.2.8" "vue": "3.2.8"
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@vant/cli", "name": "@vant/cli",
"version": "4.0.0-beta.4", "version": "4.0.0-beta.5",
"main": "lib/index.js", "main": "lib/index.js",
"typings": "lib/index.d.ts", "typings": "lib/index.d.ts",
"bin": { "bin": {

View File

@ -1,5 +1,5 @@
import execa from 'execa'; import execa from 'execa';
import { ora } from '../common/logger'; import { consola, ora } from '../common/logger';
import { SCRIPT_EXTS } from '../common/constant'; import { SCRIPT_EXTS } from '../common/constant';
type RunCommandMessages = { type RunCommandMessages = {
@ -17,6 +17,7 @@ function runCommand(
return new Promise((resolve) => { return new Promise((resolve) => {
execa(cmd, options, { execa(cmd, options, {
preferLocal: true,
env: { FORCE_COLOR: true }, env: { FORCE_COLOR: true },
}) })
.then(() => { .then(() => {
@ -25,7 +26,7 @@ function runCommand(
}) })
.catch((err: any) => { .catch((err: any) => {
spinner.fail(messages.failed); spinner.fail(messages.failed);
console.log(err.stderr || err.stdout); consola.error(err.stderr || err.stdout);
resolve(false); resolve(false);
}); });
}); });

View File

@ -1728,10 +1728,10 @@
"@typescript-eslint/types" "4.31.0" "@typescript-eslint/types" "4.31.0"
eslint-visitor-keys "^2.0.0" eslint-visitor-keys "^2.0.0"
"@vant/cli@^4.0.0-beta.3": "@vant/cli@^4.0.0-beta.4":
version "4.0.0-beta.3" version "4.0.0-beta.4"
resolved "https://registry.npmjs.org/@vant/cli/-/cli-4.0.0-beta.3.tgz#ab1cbd1b2c7007e45814a447bb6ec2ba1f2aff6f" resolved "https://registry.npmjs.org/@vant/cli/-/cli-4.0.0-beta.4.tgz#1e6b085674e8e849983a6a8dddf9c59d399b9f03"
integrity sha512-Q1xGOjw6U3AI1c1P1XdEk6H6QuZpD7kYr7cPkrqXE/Ias8q34MDrhHxZSlPUxZFUrAwVHFKWmUk/gBNqaHxtDQ== integrity sha512-ortFKMTGDinKravnOjr0fO9MyhtJvXvj2fClBxA0vl+r84qfOma+xy3zmFdW/jFADzZoPVprwMibwyeLT0O5Hg==
dependencies: dependencies:
"@babel/core" "^7.15.0" "@babel/core" "^7.15.0"
"@babel/preset-env" "^7.15.0" "@babel/preset-env" "^7.15.0"