question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for MinGW/Cygwin as an alternative to Visual Studio

See original GitHub issue

node-gyp just needs make and gcc, which are provided by MinGW/Cygwin.

Is MinGW/Cygwin a viable option for node-gyp users instead of the colossal Visual Studio environment?

Issue Analytics

  • State:closed
  • Created 11 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
oktal3700commented, Jun 27, 2013

I’ve been able to build Node in MinGW+MSYS with a few changes. The trick is to use an MSYS build of Python. See http://opensourcepack.blogspot.co.uk/2013/06/nodejs-with-posix-path-support.html

0reactions
smaudetcommented, Jun 20, 2017

Quick note on this, with some modification I was able to get node-gyp to generate make files in msys…this involved several steps:

  1. Installing node-gyp inside the mingw-based nodejs (inside of msys)
  2. Patching the globally installed versions of node-gyp/lib/build.js and node-gyp/lib/configure.js in msys to set win = false instead of win = process.platform === ‘win32’
  3. Cleaning up the binding.gyp file in the particular package I was using (node-sass@4.5.3) and a recursed src/libsass.gyp file, to remove references to MSVS_VERSION that were causing a gyp runtime failure.
  4. Issuing a node-gyp configure command.

The above appeared to generate what seem to be appropriate build files in build, however I have not figured out quite how to run them, or if they are complete:

  1. node-gyp build runs
  2. make complains about an issue:

binding.target.mk:87: *** target pattern contains no ‘%’. Stop.

Update:

It appears this is an issue in the windows versions of make. Basically a paths problem. Its probably possible to fix this with cygpath and/or using an older version of make (msys2 comes with gnu make 4.2.1 as of this writing)

https://stackoverflow.com/questions/601516/cygwin-make-error-target-pattern-contains-no

Update2:

binding.target.mk had a /C:/ in one of the paths (probably put there in by gyp/node-gyp). That means this tool should probably do some checking for /C:/ and remove the colon -> /c/ Additionally, some relative path to srcdir was created that missed the need to add the /c/ - in msys its /c/Users, not /Users

That’s at least three areas that need patched in node-gyp.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using MinGW and Cygwin with Visual C++ and Open Folder
The latest preview improves support for alternative compilers and build environments such as MinGW and Cygwin.
Read more >
MSYS2/Cygwin/MinGW/Clang support
MSYS2/Cygwin/MinGW/Clang support extension for Visual Studio Code. This extension brings in configuration and usage of the MSYS2, Cygwin, ...
Read more >
Is MinGW (MinGW-64) better than Cygwin in terms of MSVC ...
Mingw depends on Visual C++ runtime library, which is shipped with Windows ... MSVC I would suggest using clang and it has better...
Read more >
MinGW-w64 GCC with Cygwin, Code::Blocks, and ... - YouTube
GCC #Windows # MinGW -w64Welcome to the complete GCC for Windows Episode. ... MinGW -w64 GCC with Cygwin, Code::Blocks, and Visual Studio code ......
Read more >
MinGW Alternatives and Similar Software - AlternativeTo
The best MinGW alternatives are PowerShell, Windows Terminal and Cygwin. Our crowd-sourced lists contains more than 10 apps similar to MinGW for Windows, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found