“cake build:browser”错误和 Uglify.js ——无法读取属性“Array”;未定义的

发布于 2024-11-06 06:03:41 字数 1250 浏览 2 评论 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)

I just installed Uglify.js and tried to use it to rebuild CoffeeScript, but keep getting this error. This happens when I type "cake build:browser" in the CoffeeScript directory. (I want to try my hand at modifying the CoffeeScript language.)

My Uglify.js was cloned from GitHub and the symbolic link was created in .node_libraries. Uglify is installed correctly, confirmed since it runs properly in Node and through the command line. So maybe this is a CoffeeScript problem.

Help?

/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)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深海里的那抹蓝 2024-11-13 06:03:41

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

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

OK, I was able to replicate this. But why are you cloning the UglifyJS repo? If you just do npm install uglify-js to install to the local node-modules directory (with npm 1.x), everything runs fine.

Similar issue: https://github.com/mishoo/UglifyJS/issues/140

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文