Node.js Cygwin not supported

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

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

Problem courtesy of: Mj1992


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.

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

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

If you run a 32 bit version of node:

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

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'

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

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.

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

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

Solution courtesy of: troy


With Bjørn’s suggestion ( using Console2 ) and Soyuka’s alias ( steps here ), my node.js v0.10.13 and npm v1.3.2 are now working under Babun v1.02, a Cygwin distribution.

Discussion courtesy of: xjlin0

As a simpler derivative of troy’s answer for those just looking to install NPM packages:

  1. Install Node.js with the Windows installer package.
  2. Add it to the PATH with export PATH=$PATH:"/cygdrive/c/Program Files/nodejs/" (obviously replacing the path to Node.js ‘s installation directory with where you installed it).
  3. There’s a current bug in the Windows version that can be fixed by running mkdir -p ~/AppData/Roaming/npm . This is a bug for all of Windows and not just Cygwin. At some point of the future, you won’t have to do this anymore, but the command shouldn’t have any negative side effects.
  4. Test it. Eg, npm install pretty-diff -g .
  5. In order to be able to run the newly installed software, you’ll need to add the install locations to your PATH. You can find these with npm bin -g and npm bin (the -g flag is the “global” installation location).

Not really anything special that you have to do to get it to run in Cygwin (although I can’t say if everything works).

Discussion courtesy of: Kat

From Windows, run Cygwin.bat (instead of Cygwin Terminal) then in that run node: see and reply on this answer on this effectively-same question asked 1.5 years later.

Discussion courtesy of: Destiny Architect

Use Console2, it allows you to run create tabs of CLI shells. It seems running cygwin inside console2 allows me to use node REPL just fine. I have no idea why :P

Follow this guide to add cygwin to console2:

Discussion courtesy of: Petter Thowsen

Grab and run the Windows installer.

In the Cygwin prompt type

See if it works.

Discussion courtesy of: mihai

For windows, Just run bash.exe in cmd, so that you could have a bash work around with cmd console directly, which could support ALL NODE WORKING PERFECTLY.


$ node

Discussion courtesy of: 千木郷

This recipe can be found in it’s original form on Stack Over Flow .

稿源:Node.js Recipes (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 前端开发 » Node.js Cygwin not supported

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录