npm run build 时出错了

Vue 专栏收录该内容
7 篇文章 0 订阅

问:npm run build 时报如下错误
Getting this when trying to use this plugin:

 91% additional asset processing/Users/bradennapier/Desktop/Dash OS/IDE/projects/dash-desktop/node_modules/uglifyjs-webpack-plugin/dist/index.js:240
          return new Error(`${file} from UglifyJs\n${err.message} [${requestShortener.shorten(original.source)}:${original.line},${original.column}][${file}:${err.line},${err.col}]`);
                                                                                      ^

TypeError: requestShortener.shorten is not a function
    at Function.buildError (/Users/bradennapier/Desktop/Dash OS/IDE/projects/dash-desktop/node_modules/uglifyjs-webpack-plugin/dist/index.js:240:87)
    at /Users/bradennapier/Desktop/Dash OS/IDE/projects/dash-desktop/node_modules/uglifyjs-webpack-plugin/dist/index.js:174:56
    at Array.forEach (<anonymous>)
    at /Users/bradennapier/Desktop/Dash OS/IDE/projects/dash-desktop/node_modules/uglifyjs-webpack-plugin/dist/index.js:157:21
    at step (/Users/bradennapier/Desktop/Dash OS/IDE/projects/dash-desktop/node_modules/uglifyjs-webpack-plugin/dist/uglify/index.js:110:11)
    at done (/Users/bradennapier/Desktop/Dash OS/IDE/projects/dash-desktop/node_modules/uglifyjs-webpack-plugin/dist/uglify/index.js:120:22)
    at /Users/bradennapier/Desktop/Dash OS/IDE/projects/dash-desktop/node_modules/uglifyjs-webpack-plugin/dist/uglify/index.js:125:15
    at /Users/bradennapier/Desktop/Dash OS/IDE/projects/dash-desktop/node_modules/uglifyjs-webpack-plugin/node_modules/worker-farm/lib/farm.js:191:19
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
error Command failed with exit code 1.

答:升级 uglifyjs-webpack-plugin 即可

升级方法:

npm install uglifyjs-webpack-plugin --save-dev
  • 0
    点赞
  • 0
    评论
  • 1
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

©️2021 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值