npm run build ERROR in static/js/vendor.e475838be75c71f87b37.js from UglifyJs

简介: 一个 vue2.0 项目,执行 npm run dev 正常,但是 npm run build 出现打包错误。

一个 vue2.0 项目,执行 npm run dev 正常,但是 npm run build 出现打包错误,

xxx@xxx:~/xxx/src/frontend$ npm run build 
> test@1.0.0 build /home/xxx/src/frontend
> node build/build.js
Hash: 4003cde5faa0b066a0a7
Version: webpack 3.8.1
Time: 8660ms
                                              Asset       Size  Chunks                    Chunk Names
           static/js/vendor.e475838be75c71f87b37.js    1.72 MB       0  [emitted]  [big]  vendor
              static/js/app.bf4b159892d6feccb271.js    13.6 kB       1  [emitted]         app
         static/js/manifest.01542bfecf9357fb0249.js    1.49 kB       2  [emitted]         manifest
static/css/app.9746d34b80301e3f963132f72e9f5f23.css     106 kB       1  [emitted]         app
       static/js/vendor.e475838be75c71f87b37.js.map    2.13 MB       0  [emitted]         vendor
          static/js/app.bf4b159892d6feccb271.js.map    68.5 kB       1  [emitted]         app
     static/js/manifest.01542bfecf9357fb0249.js.map    14.2 kB       2  [emitted]         manifest
                                         index.html  829 bytes          [emitted]         
ERROR in static/js/vendor.e475838be75c71f87b37.js from UglifyJs
Unexpected token: name (Simple) [./node_modules/cbor/lib/simple.js:9,0][static/js/vendor.e475838be75c71f87b37.js:4155,6]
  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! test@1.0.0 build: `node build/build.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the test@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!     /home/xxx/.npm/_logs/2017-10-27T07_45_42_739Z-debug.log


cbor 包导致的错误

解决方式 :

webpack.base.conf.js 中找到 rules 修改 test: /\.js$/ 内容如下

{
        test: /\.js$/,
        loader: 'babel-loader',
        include: [resolve('src'), resolve('test'), resolve('node_modules/cbor')]
 },


相关文章
|
8月前
Nuxt.js run build 之后生成的 dist 文件夹在哪
Nuxt.js run build 之后生成的 dist 文件夹在哪
254 0
|
5月前
|
小程序
小程序wepy踩坑-Cannot find module 'D:\node_modules\npm\bin\npm-cli.js'
小程序wepy踩坑-Cannot find module 'D:\node_modules\npm\bin\npm-cli.js'
101 0
|
28天前
Module build failed (from ./node_modules/eslint-loader/index.js)
Module build failed (from ./node_modules/eslint-loader/index.js)
39 0
Module build failed (from ./node_modules/eslint-loader/index.js)
|
4月前
|
JavaScript
npm run build ERROR in static_js_vendor.e475838be75c71f87b37.js from UglifyJs
npm run build ERROR in static_js_vendor.e475838be75c71f87b37.js from UglifyJs
|
4月前
|
应用服务中间件 nginx
Angular打包构建项目服务器运行runtime.js、polyfills.js、vendor.js报错net::ERR_ABORTED 404 (Not Found),build修改为相对路径./
Angular打包构建项目服务器运行runtime.js、polyfills.js、vendor.js报错net::ERR_ABORTED 404 (Not Found),build修改为相对路径./
|
4月前
|
JavaScript
Vue报错:npm run start npm ERR! missing script: start
Vue报错:npm run start npm ERR! missing script: start
|
5月前
|
Web App开发 JavaScript
vue踩坑-Error: Can't resolve 'sass-loader' in 'E:\Element-UI-master\src\components'
vue踩坑-Error: Can't resolve 'sass-loader' in 'E:\Element-UI-master\src\components'
45 0
|
JavaScript
vue.js项目打包报错Error: You appear to be using a native ECMAScript module configuration file
vue.js项目打包报错Error: You appear to be using a native ECMAScript module configuration file
173 0
|
JavaScript
vue.js:node_modules/_babel-runtime@6.26.0@babel-runtime/core-js/object/assign.js
vue.js:node_modules/_babel-runtime@6.26.0@babel-runtime/core-js/object/assign.js
77 0
Egg.js 项目初始化介绍
Egg.js 项目初始化介绍
93 0
Egg.js 项目初始化介绍

推荐镜像

更多