鍍金池/ 問(wèn)答/HTML/ npm run dev 可以,build報(bào)錯(cuò)

npm run dev 可以,build報(bào)錯(cuò)

昨天,我用vue-cli 創(chuàng)建一個(gè)demo項(xiàng)目,npm run dev 開(kāi)發(fā)好后,然后執(zhí)行 npm run bulid 打包,但出錯(cuò)了,如下:

ERROR in Error: Parse Error:
</html>

  • htmlparser.js:235 new HTMLParser
    [vue]/[_html-minifier@3.5.9@html-minifier]/src/htmlparser.js:235:13
  • htmlminifier.js:944 minify
    [vue]/[_html-minifier@3.5.9@html-minifier]/src/htmlminifier.js:944:3
  • htmlminifier.js:1299 exports.minify
    [vue]/[_html-minifier@3.5.9@html-minifier]/src/htmlminifier.js:1299:10
  • index.js:296
    [vue]/[_html-webpack-plugin@2.30.1@html-webpack-plugin]/index.js:296:16
  • util.js:16 tryCatcher
    [vue]/[_bluebird@3.5.1@bluebird]/js/release/util.js:16:23
  • promise.js:512 Promise._settlePromiseFromHandler
    [vue]/[_bluebird@3.5.1@bluebird]/js/release/promise.js:512:31
  • promise.js:569 Promise._settlePromise
    [vue]/[_bluebird@3.5.1@bluebird]/js/release/promise.js:569:18
  • promise.js:614 Promise._settlePromise0
    [vue]/[_bluebird@3.5.1@bluebird]/js/release/promise.js:614:10
  • promise.js:693 Promise._settlePromises
    [vue]/[_bluebird@3.5.1@bluebird]/js/release/promise.js:693:18
  • async.js:133 Async._drainQueue
    [vue]/[_bluebird@3.5.1@bluebird]/js/release/async.js:133:16
  • async.js:143 Async._drainQueues
    [vue]/[_bluebird@3.5.1@bluebird]/js/release/async.js:143:10
  • async.js:17 Immediate.Async.drainQueues
    [vue]/[_bluebird@3.5.1@bluebird]/js/release/async.js:17:14
Build failed with errors.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xxxxxx-cn-vue@1.0.0 build: `node build/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the xxxxxx-cn-vue@1.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\xxxxx\AppData\Roaming\npm-cache\_logs\2018-02-21T05_35_43_860Z-debug.log

不知如何解決,下面石package.json

"scripts": {
    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
    "start": "npm run dev",
    "build": "node build/build.js"
  },
  "dependencies": {
    "axios": "^0.18.0",
    "mint-ui": "^2.2.13",
    "vue": "^2.5.2",
    "vue-router": "^3.0.1"
  },
  "devDependencies": {
    "autoprefixer": "^7.1.2",
    "babel-core": "^6.22.1",
    "babel-helper-vue-jsx-merge-props": "^2.0.3",
    "babel-loader": "^7.1.1",
    "babel-plugin-component": "^1.1.0",
    "babel-plugin-syntax-jsx": "^6.18.0",
    "babel-plugin-transform-runtime": "^6.22.0",
    "babel-plugin-transform-vue-jsx": "^3.5.0",
    "babel-preset-env": "^1.3.2",
    "babel-preset-stage-2": "^6.22.0",
    "bootstrap": "^3.3.7",
    "chalk": "^2.0.1",
    "copy-webpack-plugin": "^4.0.1",
    "css-loader": "^0.28.0",
    "extract-text-webpack-plugin": "^3.0.0",
    "file-loader": "^1.1.4",
    "friendly-errors-webpack-plugin": "^1.6.1",
    "html-webpack-plugin": "^2.30.1",
    "jquery": "^3.3.1",
    "node-notifier": "^5.1.2",
    "optimize-css-assets-webpack-plugin": "^3.2.0",
    "ora": "^1.2.0",
    "popper": "^1.0.1",
    "popper.js": "^1.12.9",
    "portfinder": "^1.0.13",
    "postcss-import": "^11.0.0",
    "postcss-loader": "^2.0.8",
    "postcss-url": "^7.2.1",
    "rimraf": "^2.6.0",
    "semver": "^5.3.0",
    "shelljs": "^0.7.6",
    "uglifyjs-webpack-plugin": "^1.1.1",
    "url-loader": "^0.5.8",
    "vue-loader": "^13.3.0",
    "vue-style-loader": "^3.0.1",
    "vue-template-compiler": "^2.5.2",
    "webpack": "^3.6.0",
    "webpack-bundle-analyzer": "^2.9.0",
    "webpack-dev-server": "^2.9.1",
    "webpack-merge": "^4.1.0"
  },
  "engines": {
    "node": ">= 6.0.0",
    "npm": ">= 3.0.0"
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not ie <= 8"
  ]
回答
編輯回答
裸橙

已解決,html 有個(gè)標(biāo)簽沒(méi)閉合

2017年9月20日 02:35