不支持 Node.js Cygwin [英] Node.js Cygwin not supported

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

问题描述

我正在尝试安装 node.js.我遵循了本教程,却被卡在了中间.

I am trying to install node.js. I followed this tutorial and i am stuck in the middle.

当我在 cygwin 终端中编写 ./configure 时,它说不支持 cygwin".请帮帮我提前致谢.

When I write ./configure in my cygwin terminal it says "cygwin not supported". Please help me out Thanks in advance.

推荐答案

根据我的经验,Node 在 cygwin 中运行良好,Node 通常有 EINVAL 错误的似乎是 MINTTY,这是默认为 cygwin 的终端仿真皮肤".我仍然不确定为什么这些 EINVAL 错误会 100% 发生,但以下是我用来使节点工作的步骤和技巧.

Node in my experience runs fine in cygwin, what Node usually has EINVAL errors in seems to be MINTTY which is a terminal emulation 'skin' that is default to cygwin. I still am not sure why these EINVAL errors happen 100% but the following are the steps and tricks I use to get node working.

在我的/cygwin/home/{username}/.bashrc 中,我将节点添加到路径以便 cygwin 可以找到它

In my /cygwin/home/{username}/.bashrc I add node to path so cygwin can find it

export PATH=$PATH:"/cygdrive/c/Program Files/nodejs/"

如果您运行的是 32 位版本的节点:

If you run a 32 bit version of node:

export PATH=$PATH:"/cygdrive/c/Program Files (x86)/nodejs/"

然后为了让 npm 在没有 windows 的情况下运行到 linux 问题,我在管理员模式下启动 cygwin 然后运行:

Then to make npm run without windows to linux issues I launch cygwin in admin mode then run:

dos2unix '/cygdrive/c/Program Files/nodejs/npm'

此时运行文件和大多数 npm 包将在 MINTTY 中运行得很好,尽管偶尔你会遇到某些 npm 包作为业力的 EINVAL 问题.此外,您将无法直接在 MINTTY 中运行解释器,无论何时我想做这些事情,我都会运行:

At this point running files and most npm packages will run in MINTTY just fine, although every once and awhile you will run into EINVAL issues with certain npm packages as karma. Also you will not be able to run the interpreter directly in MINTTY, anytime I want to do these things I run:

cygstart /bin/bash

这将打开一个本机 cygwin bash.exe 窗口,从这里您可以运行解释器或任何导致 EINVAL 的麻烦包命令.你必须这样做有点糟糕,但我每天很少使用它,而且我太喜欢 MINTTY 以至于不使用它.

This will open a native cygwin bash.exe window, from here you run the interpreter or an any troubling package command that results in a EINVAL. It slightly sucks you have to do this but I rarely use this day to day, and I love MINTTY too much to not use it.

另请注意,您可以通过运行以下内容在 MINTTY 中运行任何一行节点代码:

Also note that you can run any one line node code in MINTTY by just running something like:

node -e "console.log('hello node')"

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

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