热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

运行webpack时出现UglifyJs错误

系统:Ubuntu16.04Node版本:6.11.0Npm版本:3.10.10运行webpack时,出现如下错误:

系统:Ubuntu 16.04
Node版本:6.11.0
Npm版本:3.10.10

运行webpack时,出现如下错误:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
ERROR in app.js from UglifyJs

TypeError: Cannot read property 'reset' of undefined

    at /home/app/myapp/client/node_modules/uglifyjs-webpack-plugin/dist/index.js:99:22

    at /home/app/myapp/client/node_modules/uglifyjs-webpack-plugin/dist/index.js:231:9

    at Array.forEach (native)

    at Compilation. (/home/app/myapp/client/node_modules/uglifyjs-webpack-plugin/dist/index.js:54:19)

    at Compilation.applyPluginsAsyncSeries (/home/app/myapp/client/node_modules/tapable/lib/Tapable.js:142:13)

    at self.applyPluginsAsync.err (/home/app/myapp/client/node_modules/webpack/lib/Compilation.js:626:10)

    at Compilation.applyPluginsAsyncSeries (/home/app/myapp/client/node_modules/tapable/lib/Tapable.js:131:46)

    at sealPart2 (/home/app/myapp/client/node_modules/webpack/lib/Compilation.js:622:9)

    at Compilation.applyPluginsAsyncSeries (/home/app/myapp/client/node_modules/tapable/lib/Tapable.js:131:46)

    at Compilation.seal (/home/app/myapp/client/node_modules/webpack/lib/Compilation.js:570:8)

    at /home/app/myapp/client/node_modules/webpack/lib/Compiler.js:474:16

    at /home/app/myapp/client/node_modules/tapable/lib/Tapable.js:225:11

    at _addModuleChain (/home/app/myapp/client/node_modules/webpack/lib/Compilation.js:472:11)

    at processModuleDependencies.err (/home/app/myapp/client/node_modules/webpack/lib/Compilation.js:443:13)

    at _combinedTickCallback (internal/process/next_tick.js:73:7)

    at process._tickCallback (internal/process/next_tick.js:104:9)



npm ERR! Linux 3.10.0-514.el7.x86_64

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "--prefix" "client" "run" "webpack-build"

npm ERR! node v6.11.0

npm ERR! npm  v3.10.10

npm ERR! code ELIFECYCLE

npm ERR! @ webpack-build: `webpack -p --config webpack.config.js`

npm ERR! Exit status 2

npm ERR!

npm ERR! Failed at the @ webpack-build script 'webpack -p --config webpack.config.js'.

npm ERR! Make sure you have the latest version of node.js and npm installed.

npm ERR! If you do, this is most likely a problem with the  package,

npm ERR! not with npm itself.

npm ERR! Tell the author that this fails on your system:

npm ERR!     webpack -p --config webpack.config.js

npm ERR! You can get information on how to open an issue for this project with:

npm ERR!     npm bugs

npm ERR! Or if that isn't available, you can get their info via:

npm ERR!     npm owner ls

npm ERR! There is likely additional logging output above.



npm ERR! Please include the following file with any support request:

npm ERR!     /home/app/myapp/npm-debug.log

即使这样安装,还是有问题:

1
2
3
4
npm install uglify-js@^2.8.0

npm ls uglify-js

/home/app/myapp

`-- uglify-js@2.8.29

这和webpack的版本会有关系吗?webpack的版本是3.1.0


推荐阅读
author-avatar
louning5257_364
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有