SimulatedGREG / electron-vue

An Electron & Vue.js quick start boilerplate with vue-cli scaffolding, common Vue plugins, electron-packager/electron-builder, unit/e2e testing, vue-devtools, and webpack.
https://simulatedgreg.gitbooks.io/electron-vue/content/
MIT License
15.47k stars 1.54k forks source link

build failed #1022

Open MangoTsing opened 4 years ago

MangoTsing commented 4 years ago
     @ ./src/renderer/components/LandingPage/LandingPage.vue?vue&type=script&lang=js& (./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/renderer/components/LandingPage/LandingPage.vue?vue&type=script&lang=js&) 3:0-52 7:35-52
     @ ./src/renderer/components/LandingPage/LandingPage.vue?vue&type=script&lang=js&
     @ ./src/renderer/components/LandingPage/LandingPage.vue
     @ ./src/renderer/router/index.js
     @ ./src/renderer/main.js

    ERROR in unknown: Unexpected token (27445:12)
    Child html-webpack-plugin for "index.html":
             Asset     Size  Chunks  Chunk Names
        index.html  533 KiB       0  
        Entrypoint undefined = index.html
        [0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.ejs 1.14 KiB {0} [built]
        [1] ./node_modules/lodash/lodash.js 528 KiB {0} [built]
        [2] (webpack)/buildin/module.js 497 bytes {0} [built]

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! a@0.0.1 build: `node .electron-vue/build.js && electron-builder`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the a@0.0.1 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!     /.npm/_logs/2020-06-13T12_34_10_879Z-debug.log

I installed a third-party library I can run successfully without installing it

The following is the source code address https://github.com/DataV-Team/Datav

azwc commented 4 years ago

Same error.

ERROR in unknown: Unexpected token (16365:20)
    Child html-webpack-plugin for "index.html":
             Asset     Size  Chunks  Chunk Names
        index.html  533 KiB       0
        Entrypoint undefined = index.html
        [0] ./node_modules/html-webpack-plugin/lib/loader.js!./src/index.ejs 1.15 KiB {0} [built]
        [1] ./node_modules/lodash/lodash.js 528 KiB {0} [built]
        [2] (webpack)/buildin/module.js 497 bytes {0} [built]

error Command failed with exit code 1.
yetianyue commented 4 years ago

Error OKAY take it awayelectron-builder`

• electron-builder version=20.44.4 • loaded configuration file=package.json ("build" field) • writing effective config file=build/builder-effective-config.yaml Error: Unresolved node modules: vue at /Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_app-builder-lib@20.44.4@app-builder-lib/src/util/packageDependencies.ts:112:21 at Generator.next () at Generator.tryCatcher (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/util.js:16:23) at PromiseSpawn._promiseFulfilled (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/generators.js:97:49) at Promise._settlePromise (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/promise.js:609:26) at Promise._settlePromise0 (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/promise.js:729:18) at Promise._fulfill (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/promise.js:673:18) at Promise._resolveCallback (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/promise.js:466:57) at Promise._settlePromiseFromHandler (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/promise.js:559:17) at Promise._settlePromise (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/promise.js:604:18) at Promise._settlePromise0 (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/promise.js:649:10) at Promise._settlePromises (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/promise.js:725:18) From previous event: at Promise.longStackTracesCaptureStackTrace [as _captureStackTrace] (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/debuggability.js:482:19) at new PromiseSpawn (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/generators.js:43:17) at /Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_bluebird@3.7.2@bluebird/js/release/generators.js:197:21 at Packager.build (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_app-builder-lib@20.44.4@app-builder-lib/src/packager.ts:288:14) at build (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_app-builder-lib@20.44.4@app-builder-lib/src/index.ts:59:28) at build (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_electron-builder@20.44.4@electron-builder/src/builder.ts:228:10) at then (/Users/yetianyue/vue-electron/machine-interconnection-terminal/node_modules/_electron-builder@20.44.4@electron-builder/src/cli/cli.ts:49:19) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! machine-interconnection-terminal@1.0.0 build: node .electron-vue/build.js && electron-builder npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the machine-interconnection-terminal@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! /Users/yetianyue/.npm/_logs/2020-06-16T01_08_05_702Z-debug.log`

MangoTsing commented 4 years ago

I found a solution

Delete one of the lines webpack.renderer.config.js

const webpack = require('webpack')
// const MinifyPlugin = require("babel-minify-webpack-plugin") // delete
const CopyWebpackPlugin = require('copy-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')

and

rendererConfig.plugins.push(
    // new MinifyPlugin(), // delete
    new CopyWebpackPlugin([]), 
)

If you don't use this plugin, you can build normally

It may be that some grammars are not supported

Hope can help you

1046617651 commented 3 years ago

I think that you have install some node modules in devDependencies.But you should install it in dependencies