node.js - Vue.js 服务卡在 40% 如何恢复?

标签 node.js vue.js vue-cli

我决定删除 Node 模块文件夹,执行 npm install 然后执行 npm runserve 它总是卡在 40% 左右并永远停留在那里。当从 UI 完成时,它也会卡在类似的数量上:

$ vue-cli-service serve --open --mode development --https --dashboard INFO Starting development server...

40% building 118/134 modules 16 active ...tApp\node_modules\axios\lib\defaults.js

另一个时间:

40% building 134/147 modules 13 active ...\node_modules\axios\lib\adapters\xhr.js

我注意到 Node.js 进程一直在 15% 左右运行,但如果我等啊等啊,什么也没有发生。

enter image description here

Package.json

{
  "name": "myapp",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    "test:e2e": "vue-cli-service test:e2e",
    "test:unit": "vue-cli-service test:unit"
  },
  "dependencies": {
    "@aspnet/signalr": "^1.1.4",
    "axios": "^0.18.0",
    "vue": "^2.6.10",
    "vue-axios": "^2.1.4",
    "vue-router": "^3.0.6",
    "vuex": "^3.1.1"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "^3.7.0",
    "@vue/cli-plugin-e2e-cypress": "^3.7.0",
    "@vue/cli-plugin-eslint": "^3.7.0",
    "@vue/cli-plugin-unit-jest": "^3.7.0",
    "@vue/cli-service": "^3.7.0",
    "@vue/eslint-config-standard": "^4.0.0",
    "@vue/test-utils": "^1.0.0-beta.20",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "^10.0.1",
    "babel-jest": "^23.6.0",
    "eslint": "^5.16.0",
    "eslint-plugin-vue": "^5.2.2",
    "node-sass": "^4.12.0",
    "sass-loader": "^7.1.0",
    "vue-template-compiler": "^2.6.10"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "@vue/standard"
    ],
    "rules": {
      "space-before-function-paren": [
        "error",
        {
          "anonymous": "always",
          "named": "always",
          "asyncArrow": "always"
        }
      ],
      "keyword-spacing": [
        "error",
        {
          "after": true
        }
      ],
      "semi": [
        "error",
        "always"
      ],
      "indent": "off",
      "vue/script-indent": [
        "warn",
        2,
        {
          "baseIndent": 1
        }
      ]
    },
    "parserOptions": {
      "parser": "babel-eslint"
    }
  },
  "postcss": {
    "plugins": {
      "autoprefixer": {}
    }
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ],
  "jest": {
    "moduleFileExtensions": [
      "js",
      "jsx",
      "json",
      "vue"
    ],
    "transform": {
      "^.+\\.vue$": "vue-jest",
      ".+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$": "jest-transform-stub",
      "^.+\\.jsx?$": "babel-jest"
    },
    "moduleNameMapper": {
      "^@/(.*)$": "<rootDir>/src/$1"
    },
    "snapshotSerializers": [
      "jest-serializer-vue"
    ],
    "testMatch": [
      "**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)"
    ],
    "testURL": "http://localhost/"
  }
}

$ node --version v10.15.3

我该如何恢复?

更新: 40 这个数字有一些魔力,我删除了所有提到的 Axios,现在我仍然停留在 40%,但有一个不同的东西:

40% building 133/146 modules 13 active ...abel\runtime-corejs2\core-js\promise.js

最佳答案

就我而言:

这是模板中的一个错误。 确保后面有一个容器标签 <template><container_tag> ... your code ...</container_tag></template>它可以像 <div> 一样简单

关于node.js - Vue.js 服务卡在 40% 如何恢复?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56219332/

相关文章:

node.js - 我在连接 mongodb 和express 时遇到错误,我的终端疯了

javascript - 在 Vue 应用程序中粘贴大内容时,Quill 编辑器会稍微向上滚动

javascript - Vue动态列表

node.js - Expressjs 域重定向在 OpenShift 上不起作用

node.js - 语法错误: Unexpected token ; while compiling ejs

javascript - Node JS Json Web token Router.use() 需要中间件函数,但未定义

wordpress - 在/wp-admin 中的 WordPress 插件中设置 Vue.js (vue-cli) 热重载

javascript - 无法在.env文件中指定url vue cli 3

vue.js - Vue - 从另一个站点加载外部组件

javascript - 在 Vue 中代理 webpack 开发服务器