I have successfully compiled node.js using cygwin on windows.
The problem is that my environment is set up with Appserv.
Is there a way to compile node.js so that it can be used as an executable outside of cygwin?
See this and this - currently there is no native non-cygwin version.
Related
Is it possible to cross-compile a program targeting a Cygwin environment from a Linux/Unix host? I'm mostly trying to avoid using a Windows WM for building a collection of programs.
From the website:
Cygwin is not:
a way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows.
mingw-w64 is not enough, I need a full POSIX platform. I'm also wondering if it's possible to target MSYS2.
Perhaps I'm not understanding correctly, and one doesn't need to compile in Cygwin but only mingw-w64 is necessary.
Thanks!
It is possible to compile for Cygwin from Linux.
The cygwin1.dll itself is built in such way.
Packages/libraries are available at:
https://copr.fedorainfracloud.org/coprs/yselkowitz/cygwin/
Of course only a minimal set of tools/libraries is available
I've created an electron application which uses two NodeJS native modules node ref and node ffi. The application is being developed on windows right now and the windows executable is generated with the help of electron-builder. This all works perfectly fine and the application is installed in windows properly. As both ffi and ref are native modules, I'm simply use electron-rebuild to rebuild them for platform win32 (I guess that internally uses node-gyp).
But the problem is, my CI/CD server is Ubuntu 16 and I need to generate the windows executable file there. If my application doesn't have node's native addons, it works fantastic but with native modules included, the exe file is generated but on launch it says %1 is not a win32 application and the reason for that is, the native deps are rebuilt for Linux platform instead of windows.
So I wanted to know is, is there any way to rebuild the node native modules on Linux machine for win32 platform or if its not possible then how can we use the pre-built .node file across the platforms.
I'm currently writing a node-webkit application which uses a native module (lwip). I found out that I need to compile native modules with nw-gyp.
After using nw-gyp a new file lwip_image.node will be created under node_modules/lwip/build/Release.
How is the native module required? Like this: var lwip_image = require('./node_modules/lwip/build/Release/lwip_image.node') ??
If the native module was created on Win8 x64, will it also work on Win7 x64 or even Win8/7 x32? Same question for Mac vs Ubuntu x32 vs Ubuntu x64?
To facilitate the build process I would build the native modules on the target platforms once. After that I would like to copy them all to my project dir so I can automate the build process to build it for all platforms at once. How would I go about that? Use os.platform() and require depending on platform? ...
UPDATE: Those posts were what I was looking for: https://github.com/joyent/node/issues/4398#issuecomment-11233144
https://github.com/npm/npm/issues/1891
Your module's short name will be used in "require"
Your 32-bit code (compiled with target=ia32) will work on 64-bit platform, but not the other way around
After you have compiled your module for all platforms, it should be enough to pack different zip, .app or .exe versions for different platforms, with different respective binaries of your module.
Sometime back I've installed nodejs via cygwin which shows me the version 0.4.12 when I do node -v in bash.
Recently I've installed nodejs with the window installer which shows me the version 0.10.20 in window command prompt.
My Problem is I'm using Claymate for GumbyFramework in cygwin and it requires nodejs version above 0.8.0. How can I update the Nodejs in cygwin to the latest version?
Btw I'm using Windows Vista OS.
Pls. help!! Thanks in Advance..
Please know that Cygwin is not a supported platform. There would be a node version which would break things for you. The latest version that compiles natively on Cygwin is 0.4.12. Though the wiki page mentions some people had success building Node.js 0.10 on MinGW+MSYS. Try the following instructions : http://opensourcepack.blogspot.co.uk/2013/06/nodejs-with-posix-path-support.html
Don't mess with compile on Windows. You may want to just replace the old version Node.exe file with the newer Node.exe file on disk. You should be able to find the Cygwin folders within Windows explorer. You can search the entire disk, in windows not cygwin, for the file name node.exe. You should see the node.exe windows is finding, and the one cygwin is finding, under the cygwin folders.
Rename the cygwin node.exe and copy in the newer node.exe. Now, you nay get an issue with npm, in which case you may want to try the same thing with the npm folder.
I know cygwin isnt officially supported, but when you get it installed correctly it works.
I'm using the latest node.js for Windows x86.
I tried to use the node-sharp package from github.
It does compile, but when I load it into the node.js process (via require('./Sharp')),
The rather strange error: Error: no error, cannot load the module C:\path\to\module\Sharp.node occurs.
Has anyone also tried to use this library?
Actually, a better alternative is Edge.js, it is more stable and works now both on Linux and Windows