Tag: linux

什么是适合我的Firefox版本的geckodriver?

我正在尝试使用Firefox在Amazon Linux上运行nodeJs(节点v 8.8.1)自动化testing。 由于亚马逊Linux的一些限制,最新版本的firefox taht实际上运行的是41.下面是我的Firefox和亚马逊版本… [myuser@mymachine ~]$ firefox -v Mozilla Firefox 41.0 [myuser@mymachine ~]$ uname -a Linux ip-33-22-3-77 4.9.51-10.52.amzn1.x86_64 #1 SMP Fri Sep 29 01:16:19 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux 我的问题是,我使用什么版本的Geckodriver与此版本的Firefox兼容? 有了最新版本,我们得到错误,试图产生一个Firefox窗口,没有在我们的path壁虎驱动程序,我们得到了错误 /home/jboss/node_modules/selenium-webdriver/firefox/index.js:354 throw Error( ^ Error: The geckodriver executable could not be found on the current PATH. Please download the latest version from […]

在Linux服务器上创build守护进程的最佳实践

这是塞纳里奥: 我们有一个运行在NodeJS上的站点。 我们定期从互联网上提取一些数据,分析数据,并更新MySQL数据库。 我的问题是: 创buildLinux守护进程的最佳实践是什么? GCC? 我可以用PHP或其他语言来完成吗? 由于NodeJs将访问相同的数据库,我们如何创build互斥体? 我们如何pipe理守护进程? 例如,如果守护进程崩溃,我们希望自动重启它。

seteuid在node.js中

我怎样才能临时删除Node.js的根权限? 我可以看到标准库中的process.setuid ,但没有seteuid ,它不能是临时的。 试图再次获得root权限失败。

为Node.jssubprocess定制标准input

是否有可能在Linux下使用自定义标准input在Node.js中执行subprocess? 文档是指仅供内部使用的stdinStream : 有几个内部选项。 特别是stdinStream,stdoutStream,stderrStream。 他们只供内部使用。 与Node中所有未公开的API一样,不应使用它们。 为什么只用于内部使用? 我也试图给我自定义的可读stream,但它产生了一个非常讨厌的V8exception。 使用内部API后没有意外… 一些背景:我需要在Node.js进程closuresstdin之后执行git commit (这是我目前无法解决的问题)。 问题是, 如果你尝试使用一个closures的stdin , Git会非常生气 。 更新:我的问题实际上源于一个Node.js错误 ,但我会在这里保留这个问题,因为我认为我不只是一个想知道这一点。

node:加载共享库时出错:libv8.so.3

在新机器上安装节点后遇到错误。 $ -node node: error while loading shared libraries: libv8.so.3: cannot open shared object file: No such file or directory 我试着按照http://code.google.com/p/v8/wiki/BuildingWithGYP中的说明安装v8 但运气很less。 在这个问题上的任何帮助? 我的系统是 SUSE Linux Enterprise Server 11(x86_64)VERSION = 11 PATCHLEVEL = 2 先谢谢你,

最轻的Node.js Linux发行版

什么是Node.js的超轻型Linux发行版 没有GUI,只是bash。 计划运行Azure Extra Small VM实例。 共享CPU核心,768MB内存。

当我想运行Coffeescript cake命令时,为什么最终运行CakePHP的cake命令?

我正在尝试在Ubuntu 12.04上首次运行给givenwhenthen节点模块,并按照其运行故事标题下列出的设置说明进行操作。 我已经在/~/node_modules/givenwhenthen/examples/添加了任务test:acceptance我的cakefile,如下所示: task 'test:acceptance', 'Runs the acceptance tests', (options = {}) -> givenwhenthen.runner.runStories(options) 当我从同一个目录运行cake时,我得到如下path: CakePHP v2.2.2 Console App: examples Path: /home/kyoob/node_modules/givenwhenthen/examples/ Root: /home/kyoob/node_modules/givnwhenthen Core: /usr/share/php/cakephp/lib 我没有看到test:acceptance “可用壳”下的test:acceptance ,我根本没有看到“可用任务”部分。 应该在这里列出吗? 当我运行cake test:acceptance从这个目录cake test:acceptance这里是我得到的消息: Shell class Test:acceptanceShell could not be found. #0 /usr/share/php/cakephp/lib/Cake/Console/ShellDispatcher.php(191): ShellDispatcher->_getShell('test:acceptance') #1 /usr/share/php/cakephp/lib/Cake/Console/ShellDispatcher.php(69): ShellDispatcher->dispatch() #2 /usr/share/php/cakephp/lib/Cake/Console/cake.php(43): ShellDispatcher::run(Array) #3 {main} 我已经尝试了和没有sudo相同的效果。 我是编译CoffeeScript文件的新手,所以我担心这是我的一个菜鸟错误。 我想从错误的目录编译? 我错过了什么明显的东西?

pipe道不被subprocess读取?

我想运行node.js作为一个subprocess并为其提供input。 使用C,这里是我的一些示例代码。 我遇到的问题是,尽pipesubprocess的stdout仍然是针对terminal的,但是在给subprocess标准input一个'Hello World'行后,我什么也看不到。 即使我()pipe道,我没有看到输出。 但是,如果我closures了pipe道的input,那么terminal上会出现“Hello World”。 subprocess似乎只是缓冲 – 为什么呢? 我想最终将subprocessstdoutredirect到另一个pipe道,并从main()中读取它。 int main(int argc,char * argv []){ int toNode[2]; pipe(toNode); pid_t child_pid = fork(); if (child_pid == 0) { // child // close write end close(toNode[1]); // connect read end to stdin dup2(toNode[0], STDIN_FILENO); // run node executable char* arg_list[] = { "/usr/bin/node", NULL}; execvp(arg_list[0], […]

Linux杀掉我的进程内存不足,怎么看我用了多less?

继我以前的问题( 防止我的node.js应用程序被操作系统杀死 ),我已经重写了我如何下载文件的gestion。 为了使它简短,我需要下载一些video文件(testing文件是3video,MP4,〜3分钟),我一次全部下载,过程中被杀死,dmesg说(2下载完成后): Out of memory: kill process (node) score 824 or sacrifice child Killed process (node)… 所以我通过下载video一个又一个地重试,但在第二次下载,我得到完全相同的消息,我的程序被杀害。 有什么方法可以看到我的代码的哪一部分出错了,或防止Linux杀死我的进程? 顺便说一句,不是三个同时下载比一个吃了更多的内存? 那么,为什么我会一个接一个地杀人呢? 该应用程序运行在树莓派,没有GUI,raspbian,我相信是唯一的应用程序正在运行(除了系统进程) 编辑:关于function的一些细节,以及我认为现在如何工作:应用程序是在节点启动,而不是在任何浏览器。 由于一个接一个下载video,我以为会less吃点内存,但是因为我一下子下载了更多的数据,似乎是错误的,原因是停止似乎是一样的。 这里的下载function,以防万一它可以帮助: file_url的types是http://adress.com/rpi/test.mp4 function download (file_url, callback){ var option={host:url.parse(file_url).host, port:80, path:url.parse(file_url).pathname}; var file_name=url.parse(file_url).pathname.split('/').pop(); var file=fs.createWriteStream(DOWNLOAD_DIR+file_name); //Seems to crash while here: http.get(options, function(res){ res.on('data', function(data){ file.write(data); }).on('end'), function(){ file.end(); callback(DOWNLOAD_DIR+file_name); }); }); […]

为什么npm要求input密码?

我在Windows 8(使用vagrant)上运行CentOS6.4虚拟框,我试图安装我的项目的依赖包括proto 。 我正在运行npm install proto ,它会提示我input密码。 WTH? 为什么npm会提示我input密码? https://github.com/isaacs/npm/issues/3956