0

我刚刚安装了 Uglify.js 并尝试使用它来重建 CoffeeScript,但不断收到此错误。当我在 CoffeeScript 目录中键入“cake build:browser”时会发生这种情况。(我想尝试修改 CoffeeScript 语言。)

我的 Uglify.js 是从 GitHub 克隆的,符号链接是在 .node_libraries 中创建的。Uglify 安装正确,确认它在 Node 中和通过命令行正常运行。所以也许这是一个 CoffeeScript 问题。

帮助?

/Users/myuser/projects/UglifyJS/lib/process.js:475
                        return options.defines[name];
                                              ^
TypeError: Cannot read property 'Array' of undefined
    at get_define (/Users/myuser/projects/UglifyJS/lib/process.js:475:47)
    at Array.<anonymous> (/Users/myuser/projects/UglifyJS/lib/process.js:527:32)
    at walk (/Users/myuser/projects/UglifyJS/lib/process.js:215:47)
    at Array.<anonymous> (/Users/myuser/projects/UglifyJS/lib/process.js:164:59)
    at walk (/Users/myuser/projects/UglifyJS/lib/process.js:220:36)
    at Array.<anonymous> (/Users/myuser/projects/UglifyJS/lib/process.js:146:43)
    at walk (/Users/myuser/projects/UglifyJS/lib/process.js:220:36)
    at /Users/myuser/projects/UglifyJS/lib/process.js:1643:37
    at Array._block (/Users/myuser/projects/UglifyJS/lib/process.js:81:34)
    at walk (/Users/myuser/projects/UglifyJS/lib/process.js:220:36)
4

1 回答 1

1

好的,我能够复制这个。但是你为什么要克隆 UglifyJS 存储库?如果您只是npm install uglify-js安装到本地node-modules目录(使用 npm 1.x),一切运行正常。

类似问题:https ://github.com/mishoo/UglifyJS/issues/140

于 2011-05-10T14:48:47.293 回答