【问题标题】:Cannot build vue project无法构建 vue 项目
【发布时间】:2018-02-27 09:23:31
【问题描述】:

我正在尝试构建我的 vue 项目并将其推送到 github 页面中。

我正在尝试运行npm run build,但我得到的只是这个:

> my-domain@1.0.0 build /Users/macbookair/Workspace/fun/mine/web
> cross-env NODE_ENV=production webpack --progress --hide-modules

Hash: 2399923ef57865258a1f                                                           
Version: webpack 3.11.0
Time: 9252ms
       Asset    Size  Chunks                    Chunk Names
    build.js  740 kB       0  [emitted]  [big]  main
build.js.map  919 kB       0  [emitted]         main

ERROR in build.js from UglifyJs
Unexpected token: punc (() [build.js:503,6]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! andre.js.org@1.0.0 build: `cross-env NODE_ENV=production webpack --progress --hide-modules`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the andre.js.org@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/macbookair/.npm/_logs/2018-02-27T09_19_23_677Z-debug.log

我也尝试运行npm run build; push-dir --dir=dist --branch=gh-pages --cleanup,我得到的只是这个:

> andre.js.org@1.0.0 build /Users/macbookair/Workspace/fun/mine/web
> cross-env NODE_ENV=production webpack --progress --hide-modules

Hash: 2399923ef57865258a1f                                                           
Version: webpack 3.11.0
Time: 9524ms
       Asset    Size  Chunks                    Chunk Names
    build.js  740 kB       0  [emitted]  [big]  main
build.js.map  919 kB       0  [emitted]         main

ERROR in build.js from UglifyJs
Unexpected token: punc (() [build.js:503,6]
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! andre.js.org@1.0.0 build: `cross-env NODE_ENV=production webpack --progress --hide-modules`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the andre.js.org@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/macbookair/.npm/_logs/2018-02-27T09_22_29_715Z-debug.log

我真的不知道如何构建它,因为我是 Vue 新手,我正在使用 webpack-simple vue 模板

【问题讨论】:

标签: javascript webpack vue.js


【解决方案1】:

你可以试试这个选项: https://github.com/creotip/vue-particles/issues/7

但也许更好的选择是重新安装 npm

【讨论】:

    【解决方案2】:

    你使用版本:webpack 3.11.0

    尝试安装最新版本

     $ npm i -D webpack@latest
     $ npm run build
    

    【讨论】:

      猜你喜欢
      • 2019-12-21
      • 2020-11-29
      • 1970-01-01
      • 2021-06-10
      • 2021-11-21
      • 2021-05-25
      • 2021-09-11
      • 2019-07-01
      • 1970-01-01
      相关资源
      最近更新 更多