Tag: cygwin

在Cygwin上运行Node.js作为服务

我试图通过cygwin运行一个Node.js http服务器作为一个服务,所以即使一旦我注销(机器仍在运行),它仍然继续运行。 我能find的最近的是: cygrunsrv -I service_name-p path [-a arguments] [-e VAR=VALUE] [-t auto|manual] [-u user] [-w passwd] 用作 cygrunsrv -I nodeserver -p /usr/local/bin/node -a ~/server.js 但似乎没有正常运行…不知道我在做什么错,或者如果这是可能的

为Node.js编译本地C ++模块,链接到openSSL / libcrypto失败

我正在使用Cygwin / Windows,我正在尝试为node.js构build本地模块。 我打算使用OpenSSL库。 我已经从Cygwin软件包pipe理器安装了openssl。 我的.cc文件中有以下几行: #include <openssl/dh.h> 和 DH* public_dh_key = DH_new(); 但是当我尝试链接/编译它与node-waf configure build ,我得到: undefined reference to _DH_new 编辑: 构build脚本的一部分: def build(bld): ppp= bld.new_task_gen('cxx', 'shlib', 'node_addon') ppp.cxxflags = ["-g", "-D_FILE_OFFSET_BITS=64", "-D_LARGEFILE_SOURCE", "-Wall", "-L/usr/lib", "-lssl"] … (我已经尝试添加-lcrypto,但仍得到相同的结果,我也尝试了各种组合“-lssl32”,“ – lssleay32”,“ – llibeay32”。) 编辑 构build脚本的输出: $ node-waf configure build Checking for program g++ or c++ […]

curlhttp://npmjs.org/install.sh | sh在Cygwin失败

我无法在cygwin上安装npm。 我已经安装了节点v0.4.12,它应该是cygwin上nodejs的最后支持版本。 这是我得到的错误: curl http://npmjs.org/install.sh | sh % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 85 0 85 0 0 344 0 –:–:– –:–:– –:–:– 904 sh: line 1: syntax error near unexpected token `newline' sh: line 1: `<html>Moved: <a href="https://npmjs.org/install.sh">https://npmjs.org/install.sh</a>' 请帮我解决这个问题。 TIA。

使用grunt dev不能杀死节点js进程?

我目前正在运行一个使用GruntJS运行Web应用程序的Web应用程序。 我通常inputgrunt dev来启动它,我可以通过我的本地主机来查看它。 当我使用Ctrl + Z (我在Windows 7上使用Cygwin)退出进程时,我正常退出,因为Cygwin在grunt dev运行时“挂起”。 这是它正常工作时输出的内容: Running "shell:nodeStart" (shell) task INFO: Configuration Override: CONFIG.MONGO.URL_CONNECTION : OK INFO: Running in single node environment INFO: MongoDB is ready info: socket.io started [1]+ Stopped grunt dev 但是,当我对代码进行更改,然后再次键入grunt dev时,Cygwin不会挂起 – 它只是回到命令行,我不知道为什么。 以下是发生了什么事的照片: Running "shell:nodeStart" (shell) task INFO: Configuration Override: CONFIG.MONGO.URL_CONNECTION : OK INFO: Running in […]

npm运行什么都不做

我一直在使用Node.js / npm一段时间,但我从来没有使用npm脚本。 我很惊讶地发现,我无法让他们在我的Windows / Cygwin系统上工作。 有了像这样的package.json … { "name": "demo", "scripts": { "env": "env", "hello": "echo Hello!", "crap": "I am complete nonsense." } } …所有三个npm运行命令什么也不做。 npm run crap执行并立即返回一个OK状态(我用-dd参数testing过); npm run doesntexist会引发预期的错误。 在没有Cygwin的情况下,在常规Windowsshell上进行testing没有任何区别

为什么mkdir <path>在npm中运行失败?

我在Windows上使用Cygwin bash。 当我运行mkdir -p dist/ts它工作正常。 但是,当相同的被添加到像package.json脚本 "scripts": { "test1": "mkdir -p dist/ts " } npm返回以下错误: The syntax of the command is incorrect. npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\mmauricepinto\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "test1" npm ERR! node v5.10.1 npm ERR! npm v3.8.6 npm ERR! code ELIFECYCLE npm ERR! angular2-google-maps@0.16.0 test1: `mkdir -p dist/ts` npm ERR! […]

使node.js中的服务器简单的hello world

我已经通过以下文章安装了节点https://github.com/ry/node/wiki/Building-node.js-on-Cygwin-%28Windows%29 现在我已经在c:/cygwin/home/adminstrator/test.js中创build了一个test.js文件,这里是我的节点文件夹。 我的test.js文件是 var sys = require("sys"), http = require("http"); http.createServer(function(request, response) { response.sendHeader(200, {"Content-Type": "text/html"}); response.write("Hello World!"); response.close(); }).listen(8080); sys.puts("Server running at http://localhost:8080/"); 但在浏览器中如果运行本地主机:8080或8.8.8.8:8080内容不显示(“你好世界”) 请build议我该怎么办? 运行命令时编辑错误 $ node /home/Administrator/test.js Server running at http://localhost:8080/ /home/Administrator/test.js:5 response.sendHeader(200, {"Content-Type": "text/html"}); ^ TypeError: Object #<a ServerResponse> has no method 'sendHeader' at Server.<anonymous> (/home/Administrator/test.js:5:15) at Server.emit (events.js:27:15) at HTTPParser.onIncoming […]

Node.JS错误:找不到模块'posix'(使用Cygwin)

我正在尝试使用Cygwin运行一个简单的node.js webserver 。 我安装节点后, 将 文件复制到test.js ,这就是我得到的。 $ node test.js node.js:116 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: Cannot find module 'posix' at Function._resolveFilename (module.js:299:11) at Function._load (module.js:245:25) at require (module.js:327:19) at Object.<anonymous> (/home/me/test.js:27:13) at Module._compile (module.js:383:26) at Object..js (module.js:389:10) at Module.load (module.js:315:31) at Function._load (module.js:276:12) at Array.<anonymous> (module.js:402:10) […]

在Cygwin上构buildnode.js的问题,请大家帮忙

我想让node.js在Windows 7上运行。我没有使用Linux的经验,所以我只是盲目地遵循我find的教程的指示,但是我仍然无法构buildnode.js. 我做了什么: 安装Cygwin – 整个 尝试构buildnode.js 这是我第一次得到的错误: 然后我跟着其他两个类似的网站的命令,他们都导致了这个错误(可以得到几个版本的节点已经导致我更多的问题?我完全无能为力)。 我在某处读到Windows版本的Python可能会导致问题,所以我卸载了我的Python 2.7,并将C:\ cygwin \ bin添加到PATH中。 这仍然不起作用,我读了其他地方,我应该rebaseall所以我尝试了,但我也有一个错误: 那就是我现在所在的地方。 我采取了哪些措施加剧了这种情况?

NVM无法在Cygwin中安装任何版本的Node.js

我已经了解到,Node.js在新版本中select不支持Cygwin,但NVM无法安装旧版本。 我得到的错误: $ nvm install v0.4.12 Additional options while compiling: ######################################################################## 100.0% C:\Python27\python.exe: can't open file '/home/wvxvw/.nvm/src/node-v0.4.12/tools\ /waf-light': [Errno 2] No such file or directory nvm: install v0.4.12 failed! (格式化为可读性) 我认为这是因为Python的二进制文件没有意识到Cygwin样式的path(并找不到/home/目录)我试图从源(相同版本)build设,并面临同样的问题)。 但我不知道该怎么做。 我不想更改Python中安装的Python,可以通过Cygwin安装。 如果这个错误不仅仅是冰山一angular,我可能只是改变Makefile。 这个问题是针对那些可能会告诉我们试图“修复”Makefile是否有意义,或者我应该使用Cygwin的Python版本的问题(它的问题非常棘手,但是我认为我可以忍受这个问题… )