mirror of
https://github.com/vuejs/vue-cli.git
synced 2026-01-21 06:39:56 -06:00
fix(ui): bail on error reading package.json, closes #1599
This commit is contained in:
@@ -107,8 +107,15 @@ function writePackage ({ file, data }, context) {
|
||||
function isVueProject (file, context) {
|
||||
if (!isPackage(file)) return false
|
||||
|
||||
const pkg = readPackage(file, context)
|
||||
return Object.keys(pkg.devDependencies || {}).includes('@vue/cli-service')
|
||||
try {
|
||||
const pkg = readPackage(file, context)
|
||||
return Object.keys(pkg.devDependencies || {}).includes('@vue/cli-service')
|
||||
} catch (e) {
|
||||
if (process.env.VUE_APP_CLI_UI_DEV) {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
function listFavorite (context) {
|
||||
|
||||
Reference in New Issue
Block a user