【发布时间】:2019-07-15 22:27:24
【问题描述】:
我有一个关于 Vue.js 的项目,我为此运行 npm run serve 以设置服务器。尽管直到一个小时前它还可以正常工作,但突然间我的项目需要很长时间才能构建,更具体地说,它在 32% 上超过 5 分钟后就卡住了。有谁知道我需要做什么才能解决这个问题?我不确定我需要上传哪些文件才能解决这个问题,但这是我的 package.json 文件:
{
"name": "web",
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"jwt-decode": "^2.2.0",
"password-validator": "^4.1.1",
"vue": "^2.5.22",
"vue-cookies": "^1.5.12",
"vue-router": "^3.0.1",
"vuex": "^3.0.1"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^3.4.0",
"@vue/cli-plugin-eslint": "^3.4.0",
"@vue/cli-service": "^3.4.0",
"axios": "^0.18.0",
"babel-eslint": "^10.0.1",
"eslint": "^5.8.0",
"eslint-plugin-vue": "^5.0.0",
"vue-cli-plugin-axios": "0.0.4",
"vue-template-compiler": "^2.5.21",
"webpack-dev-server": "^3.1.14"
},
"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",
"not ie <= 8"
]
}
【问题讨论】:
-
如果对项目进行了任何更改,请尝试将其还原以调查导致构建速度变慢的代码行。如果无法突出显示此类更改,则问题可能不在于项目,而在于开发机器。简单的检查方法是在另一台机器上尝试,ofc。或者至少重新启动并检查机器上的资源使用情况。否则,问题太宽泛,无法给出有意义的答案。
标签: javascript node.js vue.js