vue.js - npm run serve 在运行时卡在 40%
问题描述
具体来说,我在 Vue js 项目 Vuetify 上工作已经有几个星期了。我使用npm run serve
命令来构建和运行实时服务器。一切正常,但突然我再次运行我的项目,boom 无法再构建它卡住了 40%,而没有抛出任何错误或错误。我想知道你们是否有类似我的问题,或者如果你知道如何解决这个问题。预先感谢。
我正在使用npm 6.9.0
,node 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"
]
}
解决方案
有时在编译过程中会出现某些错误。例如,假设我有一个带有模板的组件,其中包含以下内容
<template>
<imagingheader></imagingheader>
<router-view ></router-view>
</template>
现在这张照片有什么问题?
模板中有两个基本元素。在编译过程中,这将阻止它进一步运行,遗憾的是服务器没有开始显示此错误。将这两个元素移动到一个通用的 div 标签中可以解决问题,并将编译过程从 40% 移动到 100%。
推荐阅读
- javascript - 系统在最后的同一网格中显示错误消息(最后一列)
- electron - electron-forge:去掉 Windows 应用文件夹中的版本号
- jquery - Jquery将显示样式更改为基于组合框的div元素的display = block?
- android - 未检测到的 ID 值 Android Kotlin
- extjs - Sencha:“instanceof”的右侧不是对象
- php - 如何解决错误:找不到模块'./vendor/parse'
- reactjs - 无法通过单击按钮 React 更改页面
- node.js - Jest 中的测试函数使用来自其他函数的错误结果
- python - 如何在 Django 框架上列出特定邮政编码的 Kirana 商店/咖啡馆?
- java - 在java中转换为最接近的1000