npm run serve 运行时卡住了 40%

Bri*_*ian 9 npm vue.js vuetify.js

几个星期以来,我正在研究一个 Vue js 项目 Vuetify,具体来说。我使用npm run serve命令来构建和运行实时服务器。它运行良好,一切正常,但突然间我再次运行我的项目,Boom 无法再构建它卡住了 40%,而不会抛出任何错误或错误。我想知道你们是否有和我一样的问题,或者你知道如何解决这个问题。预先感谢。

我正在使用npm 6.9.0node v10.16.0并且vue 3.9.2

包.json

{
  "name": "mycode",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "axios": "^0.19.0",
    "core-js": "^2.6.5",
    "fuse.js": "^3.4.5",
    "moment": "^2.24.0",
    "vue": "^2.6.10",
    "vue-axios": "^2.1.4",
    "vue-i18n": "^8.12.0",
    "vue-router": "^3.0.3",
    "vue-table-component": "^1.9.2",
    "vuelidate": "^0.7.4",
    "vuetify": "^1.5.5"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^3.9.0",
    "@vue/cli-plugin-eslint": "^3.9.0",
    "@vue/cli-service": "^3.9.3",
    "babel-eslint": "^10.0.1",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.0.0",
    "live-server": "^1.2.1",
    "stylus": "^0.54.5",
    "stylus-loader": "^3.0.1",
    "typescript": "^3.5.3",
    "vue-cli-plugin-vuetify": "^0.5.0",
    "vue-template-compiler": "^2.6.10",
    "vuetify-loader": "^1.3.0"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "rules": {},
    "parserOptions": {
      "parser": "babel-eslint"
    }
  },
  "postcss": {
    "plugins": {
      "autoprefixer": {}
    }
  },
  "browserslist": [
    "> 1%",
    "last 2 versions"
  ]
}
Run Code Online (Sandbox Code Playgroud)

Moo*_*Cow 12

有时在编译过程中会发生某些错误。例如,假设我有一个包含以下模板的组件

<template>
  <imagingheader></imagingheader> 
  <router-view ></router-view>
</template>
Run Code Online (Sandbox Code Playgroud)

现在这张照片有什么问题?

模板中有两个基本元素。在编译过程中,这将阻止它继续前进,遗憾的是服务器不会开始显示此错误。将两个元素移动到一个公共 div 标签中可以解决这个问题,并将编译过程从 40% 移动到 100%。

  • 这实际上解决了我的问题。谢谢 !! (3认同)