npm run build 时出错了

问: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 ()
    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

你可能感兴趣的:(Vue)