Comments (32)
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.
- Create a new project
- install uws
- 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.
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.
@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.
@And-re I am looking into the problem with uws
. Will reply soon.
from node-packer.
@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.
@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.
@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.
from node-packer.
@And-re I'm confused. Where'd the other half of 500MB go?
from node-packer.
@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.
@pmq20 It seems to work, great job!
I compiled it like this using the master branch of node-compiler:
and suddenly the executable file is only 93.5MB :O
from node-packer.
@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
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.
from node-packer.
@And-re Oops, I have not tried win32 yet. Let me fix it right away. Thanks for reporting.
from node-packer.
@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.
@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.
@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.
@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.
@And-re Changes in your project WILL be reflected. Changes in Node.js Compiler itself WILL NOT.
from node-packer.
@pmq20 Is it ok to try the version for Windows right now or are there still some issues?
from node-packer.
@And-re there are still some issues as the CI is not green yet. I'm working on it
from node-packer.
@pmq20 ok, thank you and good luck :)
from node-packer.
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.
@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:
(in the meantime I renamed the executable file)
from node-packer.
@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.
from node-packer.
@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.
@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.
@pmq20 so it looks like the problem is with npm 5. Node 8 isn't a problem here.
When I use yarn:
When I use npm:
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.
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.
@And-re You could also try use the "--npm=..." option to opt out npm.
from node-packer.
@pmq20 Tried the latest version 1.1.0 , works well now 🎉
from node-packer.
Closing this as it has been fixed. Feel free to re-open this ticket should you need it.
from node-packer.
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)
- npm installation?
- How to hide Windows command prompt after start a.exe file
- Cannot create destination file: No such file or directory HOT 3
- Linux Exceutable Decompiling
- Will there be Nodec with Node.js 10 LTS HOT 3
- Getting Error - No such file or directory @ rb_sysopen HOT 2
- How do I separate the configuration from being compiled? HOT 1
- nodec-v1.5.0-x64 throw errors "No such file or directory - node -pe process.arch"
- How to build nodec for Window? HOT 4
- Is ARM supported? HOT 1
- i don't know how to install Linux operating system HOT 1
- Windows version does not work (Win10, nodec 1.5.0 x64) HOT 3
- Can we resurrect node-packer to get it working with latest Node.js versions? HOT 35
- Assertion `backup_off == lseek_off' failed. HOT 2
- how to use the latest source code to build binary, instead of using the old 1.5.0 version? HOT 3
- ../deps/uv/include/uv.h:37:10: fatal error: enclose_io.h: No such file or directory HOT 4
- Can the packaged executable file effectively protect the source code? HOT 1
- fatal error: Killed signal terminated program cc1 HOT 1
- fatal error: enclose_io.h: No such file or directory
- Using node packer for node 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-packer.