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')]
 },


目录
相关文章
Nuxt.js run build 之后生成的 dist 文件夹在哪
Nuxt.js run build 之后生成的 dist 文件夹在哪
427 0
|
小程序
小程序wepy踩坑-Cannot find module 'D:\node_modules\npm\bin\npm-cli.js'
小程序wepy踩坑-Cannot find module 'D:\node_modules\npm\bin\npm-cli.js'
224 0
|
3月前
|
缓存 JavaScript 前端开发
成功解决:npm 版本不支持node.js。【 npm v9.1.2 does not support Node.js v16.6.0.】
这篇文章介绍了如何解决npm版本与Node.js版本不兼容的问题,提供了查看当前npm和Node.js版本的步骤,以及如何根据Node.js版本选择合适的npm版本并进行升级的详细指导。
成功解决:npm 版本不支持node.js。【 npm v9.1.2 does not support Node.js v16.6.0.】
|
4月前
|
JavaScript
This dependency was not found:* vue/types/umd in ./src/router/index.jsTo install it, you can run
This dependency was not found:* vue/types/umd in ./src/router/index.jsTo install it, you can run
This dependency was not found:* vue/types/umd in ./src/router/index.jsTo install it, you can run
|
6月前
|
应用服务中间件 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修改为相对路径./
|
12月前
cnpm i安装报错-Install fail! Error: Unsupported URL Type: npm:vue-loader@^15.9.7
cnpm i安装报错-Install fail! Error: Unsupported URL Type: npm:vue-loader@^15.9.7
486 1
|
6月前
|
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
106 0
|
11月前
|
JavaScript
Vue报错:npm run start npm ERR! missing script: start
Vue报错:npm run start npm ERR! missing script: start
|
JavaScript
【3】npm run build Vue的项目,如何修改相对路径配置
【3】npm run build Vue的项目,如何修改相对路径配置
|
JavaScript
vue.js实战案例(3):vue启动项目报错npm ERR! missing script: serve的解决方法
vue.js实战案例(3):vue启动项目报错npm ERR! missing script: serve的解决方法
634 0