uglify js错误意外令牌eof“未定义” [英] uglify js error unexpected token eof "undefined"

查看:222
本文介绍了uglify js错误意外令牌eof“未定义”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我使用npm install uglify-js安装了npm

So I installed npm using npm install uglify-js

我运行的命令是:

cat file1.js file2.js .. fileN.js | uglifyjs -o files.min.js

我收到此错误:

WARN: ERROR: Unexpected token eof «undefined», expected punc «,» [-:630,15]

/usr/local/lib/node_modules/uglify-js/lib/parse.js:199
    throw new JS_Parse_Error(message, line, col, pos);
          ^
Error
    at new JS_Parse_Error (/usr/local/lib/node_modules/uglify-js/lib/parse.js:185:18)
    at js_error (/usr/local/lib/node_modules/uglify-js/lib/parse.js:199:11)
    at croak (/usr/local/lib/node_modules/uglify-js/lib/parse.js:630:9)
    at token_error (/usr/local/lib/node_modules/uglify-js/lib/parse.js:638:9)
    at expect_token (/usr/local/lib/node_modules/uglify-js/lib/parse.js:651:9)
    at expect (/usr/local/lib/node_modules/uglify-js/lib/parse.js:654:36)
    at ctor.argnames (/usr/local/lib/node_modules/uglify-js/lib/parse.js:897:52)
    at function_ (/usr/local/lib/node_modules/uglify-js/lib/parse.js:902:15)
    at expr_atom (/usr/local/lib/node_modules/uglify-js/lib/parse.js:1114:24)
    at maybe_unary (/usr/local/lib/node_modules/uglify-js/lib/parse.js:1278:19)

关于这是什么的任何想法或我应该如何解决它?

Any ideas on what this is about or how I should go about fixing it?

推荐答案


错误:意外的令牌eof«未定义»,预期punc«,»[ - :630,15]

ERROR: Unexpected token eof «undefined», expected punc «,» [-:630,15]

我相信所有这一切都意味着你在JS代码的某个地方错过了一个,可能在第630行附近,在字符15附近。

I believe all it means is that you are missing a , somewhere in your JS code, possibly on line 630, near character 15.

因此,如果您连接所有JS文件的源代码并查看第630行,您可能会发现解析器认为缺少逗号的位置。

So if you concatenate the source of all your JS files, and take a look at line 630, you might find where the parser thought there was a missing comma.

这篇关于uglify js错误意外令牌eof“未定义”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆