在Ubuntu上获得spidermonkey js的最佳方法? [英] Best way to get spidermonkey js on Ubuntu?

查看:175
本文介绍了在Ubuntu上获得spidermonkey js的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在我的工作机器上安装Spidermonkey JS引擎。我正在处理的项目有一个jslint脚本,需要Spidermonkey或类似的js二进制文件。我已经尝试从源代码编译Spidermonkey并陷入依赖地狱。我尝试从ubuntu存储库安装rhino软件包,结果很慢而且坏了。今天早上,我成功编译了Google的V8引擎并按照此处的说明构建了v8jslint:

I need to install the Spidermonkey JS engine on my work machine. The project I'm working on has a jslint script that requires Spidermonkey or a similar js binary. I've tried compiling Spidermonkey from source and gotten stuck in dependency hell. I tried installing the rhino package from the ubuntu repositories, and that turned out to be slow and broken. This morning, I successfully compiled Google's V8 engine and built v8jslint following the instructions here:

http://blog.stevenreid.co.uk/2011/06/27/jslint-command-line- tool-powered-by-v8 /

v8jslint有效,但一次只能打印一个文件。例如,

v8jslint works, but will only lint one file at a time. For instance,

$ v8jslint foo/*.js

如果我在foo下有a.js,b.js和c.js,v8jslint只会lint a.js.轻松修复:我可以为此编写一个bash脚本。更大的问题是v8jslint与我们的构建服务器上的Spidermonkey jslint不兼容。有没有人在最近的Ubuntu版本上构建Spidermonkey,或者知道一个好的解决方法?

if I have a.js, b.js and c.js under foo, v8jslint will only lint a.js. Easy fix: I could write a bash script for this. A bigger problem is that v8jslint is not compatible with the Spidermonkey jslint on our build server. Has anyone had any success building Spidermonkey on a recent version of Ubuntu, or know a good workaround?

推荐答案

你可以从源代码构建,但是蜘蛛猴仍然在ubuntu上可用,它只是重命名为libmozjs。安装libmozjs-24-bin然后将其称为js24或将symlink / usr / bin / js24称为js,如下所示:

You can build from source, but spider monkey is still available on ubuntu, it's just been renamed to "libmozjs". Install "libmozjs-24-bin" and then either refer to it as "js24" or symlink /usr/bin/js24 to "js", like so:

sudo apt-get install libmozjs-24-bin; sudo ln -sf /usr/bin/js24 /usr/bin/js

这篇关于在Ubuntu上获得spidermonkey js的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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