从 Cygwin 控制台启动 Node.js 的问题 [英] Trouble with starting Node.js from a Cygwin console

查看:24
本文介绍了从 Cygwin 控制台启动 Node.js 的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从常规命令提示符运行 node.exe 没有问题:

I have no trouble running node.exe from a regular command prompt:

C:>node --interactive
> console.log("Works fine");
Works fine

但是当我尝试从 Cygwin 控制台做同样的事情时,我遇到了这个:

But when I try to do the same thing from a Cygwin console, I run into this:

Olli@Olli-MBRr /cygdrive/c
$ node.exe

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: read ENOTCONN
    at errnoException (net.js:900:11)
    at Socket._read (net.js:391:21)
    at Socket.Readable.read (_stream_readable.js:320:10)
    at Socket.read (net.js:293:43)
    at new Socket (net.js:185:10)
    at process.stdin (node.js:660:19)
    at startup (node.js:145:16)
    at node.js:901:3

起初我以为可能是因为 Cygwin 的路径名中有空格(C:Program Files odejs)有问题,但是在将 node.js 安装到路径名中没有空格的目录后我无法解决问题.

At first I thought it might be because Cygwin has trouble with the path name with a space in it (C:Program Files odejs), but after installing node.js to a directory with no spaces in the path name I was unable to resolve the problem.

我想使用 js-comint 从 Emacs(从 Cygwin 运行)运行 Node JS 控制台,但我遇到了这个错误并且不知道如何解决它.

I would like to run a Node JS console from Emacs (run from Cygwin) using js-comint, but I ran into this error and have no clue how to resolve it.

推荐答案

我认为这是由于在 cygwin 中使用 win 发行版造成的,因为 cygwin 模拟了 *nix 环境,而 node.js for windows 寻找的是 win 库而不是尼克斯.为了让 node.js 在 cygwin 中工作,你必须自己构建它.最新版本也不适用于 cygwin.

I think this is caused by using the win distro in cygwin , since cygwin emulates a *nix environment and node.js for windows looks for the win libraries not the nix ones. In order for node.js to work in cygwin you have to build it yourslef. Also latest versions do no work on cygwin.

来自官方 wiki 的当前状态:不再支持 Cygwin,尽管它符合 POSIX 标准.最新编译版本为0.4.12

Current status from official wiki: Cygwin is no longer supported, despite being POSIX compliant. The latest version that compiles is 0.4.12

https://github.com/nodejs/node/wiki/Installation#building-on-cygwin

这篇关于从 Cygwin 控制台启动 Node.js 的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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