Giter VIP home page Giter VIP logo

Comments (32)

pmq20 avatar pmq20 commented on August 20, 2024

Thanks for reporting. Could you give me a series of steps to reproduce the problem on my local machine? I would definitely fix it once reproduced.

from node-packer.

chintan39 avatar chintan39 commented on August 20, 2024
  1. Create a new project
  2. install uws
  3. Try one of the examples of uws
    https://github.com/uWebSockets/bindings/blob/master/nodejs/examples/test.js

And then in the project folder I ran the command ./nodec test.js

PS: I was building on a Mac

from node-packer.

And-re avatar And-re commented on August 20, 2024

I have exactly the same problem.

The only workaround I found to successfully run my server app was to replace uws with ws but it is supposed to be slower so it's not a real solution for my problem.

I tried to use pkg as well but there is a problem with dynamic require statements in some node_modules so node-compiler seems to be the best tool in my case (only support for uws is missing)

I also tried using something like --npm-package=uws --npm-package-version=0.14.1 but I get No binaries detected inside node_modules/uws/package.json. error.

@pmq20 is there an easy way to use cross-compilation on MacOS to generate an exe file for Windows using nodec?

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@And-re I have not looked into cross-compilation yet. I personally use my Windows 7 box with Visual Studio 2015 to generate the exe.

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@And-re I am looking into the problem with uws. Will reply soon.

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@And-re Just to give a quick note that uws as a npm package alone does not seem to contain any binaries indeed, so the error about No binaries detected inside node_modules/uws/package.json. error. does not seem to be a bug.

from node-packer.

And-re avatar And-re commented on August 20, 2024

@pmq20 Thanks for the replies. I'm really excited for the support for uws.

Do you think that 500MB executable file on MacOS is normal in case of a game that takes less than 250MB with all the node_modules and assets?

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@chintan39 Hmm....Native modules are starting to work on the master branch, if you are urgent you could clone the repo and run nodec from master to try it. I'll release it once I have tested it thoroughly.

image

image

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@And-re I'm confused. Where'd the other half of 500MB go?

from node-packer.

And-re avatar And-re commented on August 20, 2024

@pmq20 Ok, I will try the master branch today.
I don't know. The game itself takes 250MB and I'm also wondering what takes the remaining space (Node.js environment?)

from node-packer.

And-re avatar And-re commented on August 20, 2024

@pmq20 It seems to work, great job!
I compiled it like this using the master branch of node-compiler:
screen shot 2017-05-12 at 21 51 35
and suddenly the executable file is only 93.5MB :O

from node-packer.

And-re avatar And-re commented on August 20, 2024

@pmq20 so I tried to use the master branch of node-compiler on Windows and it failed (I was trying many times and also cleaning the tmp directory):
https://gist.github.com/And-re/9f6928915b24688bed59e3fd89a4da27
node-compiler master

When I used the 0.9.6 version for Windows it compiled successfully but there was that error with uws when I tried to run the exe file.
node-compiler 0 9 6

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@And-re Oops, I have not tried win32 yet. Let me fix it right away. Thanks for reporting.

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@And-re Regarding 93.5MB, you could go to your_tmp_dir/__work_dir__/__enclose_io_memfs__ and check if any unwanted files are included. One common pitfall is that a.out is accidentally included.

from node-packer.

And-re avatar And-re commented on August 20, 2024

@pmq20 yes, I realized that I had a file like a.out accidentally included.

So I was using ruby to run the nodec file from the master branch like this:
ruby ..\node-compiler\bin\nodec --tmpdir="C:\Users\And_re\hax-tmp" dist\server\server.js

How do you generate the nodec.exe file and will it be much faster if I generate the nodec.exe once and use it instead of running ruby?

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@And-re I generated nodec.exe file via Ruby Compiler, a less mature project that I was working on in my spare time.

It won't be faster. If you want to make it fast to compile maybe trying out ccache(https://ccache.samba.org/manual.html). Or reusing the --tmpdir directory, but be aware to keep it in sync with the changes from master.

from node-packer.

And-re avatar And-re commented on August 20, 2024

@pmq20 ok, I see.
So if I change one file in my project and try to reuse the tmpdir from last time the change won't be reflected? Can I just copy that file manually to your_tmp_dir/__work_dir__/__enclose_io_memfs__ and reuse the rest of the files in the tmpdir?

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@And-re Changes in your project WILL be reflected. Changes in Node.js Compiler itself WILL NOT.

from node-packer.

And-re avatar And-re commented on August 20, 2024

@pmq20 Is it ok to try the version for Windows right now or are there still some issues?

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@And-re there are still some issues as the CI is not green yet. I'm working on it

from node-packer.

And-re avatar And-re commented on August 20, 2024

@pmq20 ok, thank you and good luck :)

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

Node.js Compiler v1.0.0 released! Native C++ modules are fully supported now.

https://github.com/pmq20/node-compiler/releases/tag/v1.0.0

@And-re @chintan39 Could you have a try and let me know if it works for you? Thanks!

from node-packer.

And-re avatar And-re commented on August 20, 2024

@pmq20 I'm able to run my project using Node 8.0.0 but when I compile it using node-compiler I'm getting this error:
image
(in the meantime I renamed the executable file)

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@And-re I failed to reproduce this on my local win32 machine. See the screen-shot. Could you give me a project or minimized project to reproduce the error? Thanks.

1

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@And-re Also, have you cleaned your temporary directory that the compiler uses? If old directory generated by nodec 0.x is used then it would be problematic. It needs to be cleaned when a compiler of a new version is used. I should fix this in a precautionary way: #42

from node-packer.

And-re avatar And-re commented on August 20, 2024

@pmq20 Ok, I'm using win64 and I will try to prepare a reproducable example.
Yes, everything was generated using node-compiler 1.0.0. The only problem was that I was out of heap memory 2 times and had to retry 2 times even thought I have over 8000MB of virtual memory set as you described it in another issue on github.

from node-packer.

And-re avatar And-re commented on August 20, 2024

@pmq20 so it looks like the problem is with npm 5. Node 8 isn't a problem here.
When I use yarn:
image
When I use npm:
image
But the good news is that when I used yarn to build my game and the compilation was successful in the first attempt I got a working executable!

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@And-re

Using x64 toolchain could also help eliminate the insufficient-memory problem. Microsoft x64 cl.exe (or even x64_x86 cross tool-chain) will not throw this error when x86 tools throw, based on my experiments.

from node-packer.

pmq20 avatar pmq20 commented on August 20, 2024

@And-re You could also try use the "--npm=..." option to opt out npm.

from node-packer.

chintan39 avatar chintan39 commented on August 20, 2024

@pmq20 Tried the latest version 1.1.0 , works well now 🎉

from node-packer.

lexor90 avatar lexor90 commented on August 20, 2024

Closing this as it has been fixed. Feel free to re-open this ticket should you need it.

from node-packer.

CoolHandLuke88 avatar CoolHandLuke88 commented on August 20, 2024

I ran into this exact issue.
I wanted to leave this here for anyone else that may run into this issue with docker and uws installation.

Hope you guys don't mind I drop this here.

In Dockerfile


FROM node:8.9-alpine

RUN apk add --update \
libc6-compat


Needed libc6-compact

This should resolve the issue seen below.

Error: Compilation of µWebSockets has failed and there is no pre-compiled binary available for your system. Please install a supported C++11 compiler and reinstall the module 'uws'.

from node-packer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.