pmq20 / node-packer Goto Github PK
View Code? Open in Web Editor NEWPacking your Node.js application into a single executable.
License: MIT License
Packing your Node.js application into a single executable.
License: MIT License
C:\nodejs\Application>nodec bin\www.js -r C:\nodejs\Application -d c:\nodejs\tmp
Node.js Compiler (nodec) v0.9.3 (runtime 7.5.0)
Entrance: C:/nodejs/Application/bin/www.js
Options: {:root=>"C:\\nodejs\\Application", :tmpdir=>"c:/nodejs/tmp", :npm=>"npm", :make_args=>"-j4", :vcbuild_args=>"nosign", :output=>"C:/nodejs/Application/a.exe"}
-> mkdir -p c:/nodejs/tmp
-> cp -r "C:/__enclose_io_memfs__/_local_/node" "c:/nodejs/tmp/node"
-> rm -rf c:/nodejs/tmp/__work_dir__
-> mkdir -p c:/nodejs/tmp/__work_dir__
-> cp -r "C:/nodejs/Application" "c:/nodejs/tmp/__work_dir__/__enclose_io_memfs__"
-> cd c:/nodejs/tmp/__work_dir__/__enclose_io_memfs__
-> Running ["\"npm\" -v"]
2.14.4
-> Running ["\"npm\" install"]
-> cd C:/nodejs/Application
-> cd c:/nodejs/tmp/__work_dir__/__enclose_io_memfs__
-> cd C:/nodejs/Application
-> cd c:/nodejs/tmp/node
-> rm -f deps/libsquash/sample/enclose_io_memfs.squashfs
-> rm -f deps/libsquash/sample/enclose_io_memfs.c
-> Running ["mksquashfs -version"]
C:/__enclose_io_memfs__/_local_/lib/compiler/utils.rb:26:in `spawn': No such file or directory - mksquashfs -version (Errno::ENOENT)
from C:/__enclose_io_memfs__/_local_/lib/compiler/utils.rb:26:in `run'
from C:/__enclose_io_memfs__/_local_/lib/compiler.rb:155:in `block in make_enclose_io_memfs'
from C:/__enclose_io_memfs__/_local_/lib/compiler/utils.rb:33:in `block in chdir'
from C:/__enclose_io_memfs__/_local_/lib/compiler/utils.rb:33:in `chdir'
from C:/__enclose_io_memfs__/_local_/lib/compiler/utils.rb:33:in `chdir'
from C:/__enclose_io_memfs__/_local_/lib/compiler.rb:152:in `make_enclose_io_memfs'
from C:/__enclose_io_memfs__/_local_/lib/compiler.rb:113:in `run!'
from /__enclose_io_memfs__/_local_/bin/nodec:115:in `<main>'
可以先用着这个 https://github.com/pmq20/squashfuse/files/691217/sqfs43-win32.zip
我再想想怎么提示用户装这个
Dear @pmq20, Thank you so much for the great work. I tested your Node compiler and it's outstanding. But I have some issues and thoughts to share with you.
1- I don't know much about C++ compiling, but it seems Node Compiler compiles all the C files each time and the whole build process takes so long even on a high-end machine. Is it possible to cache intermediate C++ objects before linking to reduce upcoming build time?
2- I did some testing with fs.readFile and fs.writeFile, it seems they work on the actual filesystem and it's a good idea. But the interesting thing is stylus package which generates CSS file from STYL file and stores them in assets folder doesn't work on the file system (no assets folder is created in the directory) although an empty enclose_io_memfs folder is created (which is unnecessary and probably a bug) where executable is deployed. So my question is how can read and write be done on ram partition instead of the filesystem?
3- Be able to use a custom icon and file description for the executable output. maybe an icon file in the package root directory.
4- Have predefined node command arguments like NODE_ENV=production and besides the ability to exclude files it's possible to use compiled CSS from Stylus and compiled PUG instead of plain ones. It's also a good idea to omit devDependencies packages in the package.json file.
5- I don't know if it's possible to have the app run in the background for example as a Windows service. It's a good option.
6- It's nice to be able to exclude unnecessary node built-in modules to decrease build time, output size and complexity.
7- I use closure compiler to transpile my js file to another folder, It's nice to be able to map the compiled folder to the source one during compile time. This way source is excluded and compiled takes its place.
8- I think defining options like output, tmpdir, auto-update-url and others in package.json is better than the command line as they persist in the package. maybe this format:
{..., nodec:{output:'', icon:'', description:'', args: 'NODE_ENV=production', service: true, exclude: {files: [], modules: []}, map: [{src: './jsc', dst: './js'}], ...}, ...}
9- I read the docs but didn't find anything if Node Compiler uses the V8 Compiler feature to compile JS codes for better code protection and performance. It seems enclosejs use this feature. https://github.com/v8/v8/blob/master/src/compiler.cc
Thank you for your time
Hi,
For an app that uses modbus and mbus communication, in a Raspberry, I have this error
RangeError: "size" argument must not be larger than 1073741823
This error is only thrown with the compiled app, not with the sources and not on a 64 bits system...
console.log("hello world")
nodec --skip-npm-install -r . index.js
/tmp/ccRY1e7x.s: Assembler messages:
/tmp/ccRY1e7x.s:1073: Error: expecting string instruction after `rep'
make[1]: *** [/tmp/nodec/node/out/Release/obj.target/icuucx/deps/icu-small/source/common/utrie2.o] 错误 1
make[1]: *** 正在等待未完成的任务....
/tmp/cccpM5jy.s: Assembler messages:
/tmp/cccpM5jy.s:570: Error: expecting string instruction after `rep'
make[1]: *** [/tmp/nodec/node/out/Release/obj.target/v8_libbase/deps/v8/src/base/utils/random-number-generator.o] 错误 1
/tmp/ccy5Jq5E.s: Assembler messages:
/tmp/ccy5Jq5E.s:3292: Error: expecting string instruction after `rep'
make[1]: *** [/tmp/nodec/node/out/Release/obj.target/icuucx/deps/icu-small/source/common/putil.o] 错误 1
make[1]: Leaving directory `/tmp/nodec/node/out'
make: *** [node] 错误 2
Failed running ["make -j4"]
Hello,
I wonder if there are plans to support linked packages for this project?
It would be pretty cool if I could npm link my_other_cool_package
and then compile it all together.
But when I try that, the program crashes at the point of the require - making links not usable.
Please let me know if you desire a sample "not-working-project" project.
Best regards
Good day,
I was wondering if you are planning to add support for "library only" modules and let them be included using the bindings modules or similar ones.
This would a pretty cool feature for anyone who is planning to deploy his library without any direct executable code.
What are you thoughts?
Precondition:
Windows 7 32-bit, available 2320 MB from 3400 MB.
node v7.9.0,
mksquashfs v4.3,
Visual Studio 2015,
Example coffeescript project finished failed:
"sample\enclose_io_memfs.c(166117): fatal error C1060: compiler is out of heap space"
Hello,
as discussed already in other issues I think nodec should be able to compile using a user defined node version among whose supported by the applied patches.
I didn't have any chance to test the patches with the v6.x, v7.x and v8.x but since those were versions supported by nodec itself I guess we should have some sort of support for them (by the way I'd really like to add some tests against regressions).
Patches have evolved while also upgrading the supported node version, so I think we should still be able to verify the patches apply properly and that node.js retains its functionalities after those patches are applied.
My purpose is to:
--node-version=7.0.0
flag to the nodec binary (or --runtime
, but I think node-version
is more user-friendly) and keep the latest nodejs version (or maybe the LTS) as the defaultdiff
or some ruby gem)I'd really like to avoid what other similar tools do that is to download the detected (current-system) node version: it's ugly, annoying for nvm users, error prone and furthermore in a CI/CD environment one may need to skip this (and using nvm to workaround this might get complicated as nvm is hard to be used in some shell scripts). Also I don't think there's really some logical reason one should assume that I want my local node version on my servers.
I already started to work and implemented the flag and the download part, but I'm not sure how would you like to distribute the patch: do you want to place a .patch
file inside this repo?
I'd avoid to keep the expanded source code under node/
because it could lead to unwanted patching (e.g. files modified from one version to another would be modified, and we would need to declare what files to pick explicitly, which may still get unwanted modifications.
I'd like to know your thoughts about it @pmq20
Thank you.
Failed running mksquashfs:
C:\git\Observer\Node\ObsNode>C:\nodec\nodec-x64.exe --clean-tmpdir app.js
Node.js Compiler (nodec) v1.0.0 (runtime 8.0.0)
Entrance: C:/git/Observer/Node/ObsNode/app.js
Options: {:clean_tmpdir=>true, :npm=>"npm", :make_args=>"-j4", :vcbuild_args=>"x64", :output=>"C:/git/Observer/Node/ObsNode/a.exe", :tmpdir=>"C:/Users/gre63396/AppData/Local/Temp/nodec"}
-> rm -rf C:/Users/gre63396/AppData/Local/Temp/nodec
-> mkdir -p C:/Users/gre63396/AppData/Local/Temp/nodec
-> cp -r "C:/__enclose_io_memfs__/_local_/node" "C:/Users/gre63396/AppData/Local/Temp/nodec/node"
-> rm -rf C:/Users/gre63396/AppData/Local/Temp/nodec/__work_dir__
-> mkdir -p C:/Users/gre63396/AppData/Local/Temp/nodec/__work_dir__
-> cp -r "C:/git/Observer/Node/ObsNode" "C:/Users/gre63396/AppData/Local/Temp/nodec/__work_dir__/__enclose_io_memfs__"
-> cd C:/Users/gre63396/AppData/Local/Temp/nodec/__work_dir__/__enclose_io_memfs__
-> Running ["\"npm\" -v"]
4.6.1
-> Running ["\"npm\" install --production"]
-> cd C:/git/Observer/Node/ObsNode
-> cd C:/Users/gre63396/AppData/Local/Temp/nodec/__work_dir__/__enclose_io_memfs__
-> cd C:/git/Observer/Node/ObsNode
-> cd C:/Users/gre63396/AppData/Local/Temp/nodec/node
-> rm -f deps/libsquash/sample/enclose_io_memfs.squashfs
-> rm -f deps/libsquash/sample/enclose_io_memfs.c
-> Running ["mksquashfs -version"]
mksquashfs version 4.3 (2014/05/12)
copyright (C) 2014 Phillip Lougher <[email protected]>
[----------------------------------------------------------]
Compiled by Sebastiaan Ebeltjes @ 2015-06-08 (Domoticx.nl)
Compiled with Cygwin on Windows 8.1, compiler: GCC v4.9.2
This version comes with added support for:
- LZMA v4.65
- LZMA2 (XZ) v5.5.0
- LZO v2.09
- LZ4 r130
Enjoy!
[----------------------------------------------------------]
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2,
or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-> Running ["mksquashfs \"C:/Users/gre63396/AppData/Local/Temp/nodec/__work_dir__\" deps/libsquash/sample/enclose_io_memfs.squashfs"]
Failed running ["mksquashfs \"C:/Users/gre63396/AppData/Local/Temp/nodec/__work_dir__\" deps/libsquash/sample/enclose_io_memfs.squashfs"]
This is what I see when I try to compile my js. Why is it saying no module named nodedownload? Please help....
-> cd /tmp/nodec/node
-> Running ["./configure "]
Traceback (most recent call last):
File "./configure", line 38, in <module>
import nodedownload
ImportError: No module named nodedownload
Failed running ["./configure "]
Please ignore this issue. It's the wrong forum! Sorry.
I wish there would be a option to exclude directory's and files.
TODO: make it enclose_io_memfs contained.
Thank you for this amazing compiler.
I tried to compile one of my project which is using microtime native module. I compiled it succesfully, but when I run binary I get following error:
/__enclose_io_memfs__/node_modules/node-time-uuid/node_modules/microtime/node_modules/bindings/bindings.js:83
throw e
^
Error: /__enclose_io_memfs__/node_modules/node-time-uuid/node_modules/microtime/build/Release/microtime.node: cannot open shared object file: No such file or directory
at Object.Module._extensions..node (module.js:598:18)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at bindings (/__enclose_io_memfs__/node_modules/node-time-uuid/node_modules/microtime/node_modules/bindings/bindings.js:76:44)
at Object.<anonymous> (/__enclose_io_memfs__/node_modules/node-time-uuid/node_modules/microtime/index.js:1:96)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/__enclose_io_memfs__/node_modules/node-time-uuid/lib/objectid.js:22:17)
So my question is. Are native modules supported?
Hello,
I tried to use node-compiler but I failed to run example code
git clone --depth 1 https://github.com/eggjs/examples.git
cd examples/helloworld
npm install
nodec node_modules/.bin/egg-bin
./a.out dev (or a.exe dev on Windows)
npm install
was fine but nodec node_modules/.bin/egg-bin
emit error like below
Cannot find entrance C:/Users/kangcs.SOLID/myTest/examples/node_modules/.bin/egg-bin.
Thank you!
Additional Questions
Just tried this out using the example provided by the CLI, and got this output:
Node.js Compiler (nodec) v0.9.5 (runtime 7.7.3)
It should match the enclosed Node.js runtime version of the compiler.
Expecting v7.7.3; yet got v7.8.0.
Obviously, my local version of node is 7.8.0. Does this mean I need to downgrade to 7.7.3 to use this tool? If so, this is not mentioned anywhere in the README.
Hello, does this support yarn? Thanks
Hi,
I just try to compile zeit/serve on macOS 10.12.5
After ./nodec --npm=yarn bin/serve.js
it says:
-> Running ["./configure "]
Traceback (most recent call last):
File "./configure", line 34, in <module>
from gyp.common import GetFlavor
ImportError: No module named gyp.common
Hello,
I just encountered the dreaded windows 260-character path length limitation. while trying to compile a relatively simple application that uses the Knex.js database abstraction library.
I know this is not a node-compiler problem, but was wondering if you had any workaround.
I've made some research and it appears everyone is blaming each other with this issue (Node.js, NPM, Microsoft, etc..)
Best regards,
Stephen..
I'm running a nodejs app on an embedded device (think beaglebone black or raspberry pi). For non-trivial projects, npm install
takes a significant amount of time on a live device. Instead I typically do the install from an x86 host using chroot and qemu-user-static. It seems like this would be great for simplifying app distribution for embedded targets.
I also use gcc-arm-linux-gnueabihf to cross-compile the kernel from x86 host, if it's more manageable to specify a cross-toolchain and stay within the x86 host env instead of a chroot.
FWIW I also use several native modules (serialport, bcrpypt and node-sqlite) so would possibly be impacted by #25
I know, this is a problem of shared lib.
I compiled my app on a gentoo box with glibc-2.23. Then put it on a CentOS 7 box with glibc-2.17.
jet is my app.
./jet: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./jet)
./jet: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./jet)
Do not know how to solve this problem. Can you help to solve it? What kind of information should I provide for you ?
not ok 54 parallel/test-child-process-double-pipe
# events.js:160
# throw er; // Unhandled 'error' event
# ^
#
# Error: spawn grep ENOENT
# at exports._errnoException (util.js:1026:11)
# at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
# at onErrorNT (internal/child_process.js:359:16)
# at _combinedTickCallback (internal/process/next_tick.js:74:11)
# at process._tickCallback (internal/process/next_tick.js:98:9)
# at Module.runMain (module.js:674:11)
# at run (bootstrap_node.js:389:7)
# at startup (bootstrap_node.js:144:9)
# at bootstrap_node.js:530:3
---
duration_ms: 0.177
...
I am running on a 4 core and 4 GB ram machine, but not able to complete the process.
virtual memory exhausted: Cannot allocate memory
deps/libsquash/enclose_io_libsquash.target.mk:95: recipe for target '/tmp/nodec/node/out/Release/obj.target/enclose_io_libsquash/deps/libsquash/sample/enclose_io_memfs.o' failed
make[1]: *** [/tmp/nodec/node/out/Release/obj.target/enclose_io_libsquash/deps/libsquash/sample/enclose_io_memfs.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/tmp/nodec/node/out'
Makefile:75: recipe for target 'node' failed
make: *** [node] Error 2
Failed running ["make -j4"]
after running nodec .\app\app.js --output=output/app I was encountering the following error:
-> cd D:/inetpub/wwwbasis/MyMemo
-> cd C:/Users/Admin/AppData/Local/Temp/nodec/work_dir/enclose_io_memfs
D:/enclose_io_memfs/local/lib/compiler.rb:173:in ``': No such file or directory - git status (Errno::ENOENT)
from D:/enclose_io_memfs/local/lib/compiler.rb:173:in block in npm_install' from D:/__enclose_io_memfs__/_local_/lib/compiler/utils.rb:33:in
block in chdir'
from D:/enclose_io_memfs/local/lib/compiler/utils.rb:33:in `chdir'
from D:/enclose_io_memfs/local/lib/compiler/utils.rb:33:in `chdir'
from D:/enclose_io_memfs/local/lib/compiler.rb:171:in `npm_install'
from D:/enclose_io_memfs/local/lib/compiler.rb:141:in `run!'
from /enclose_io_memfs/local/bin/nodec:143:in `
Used nodec version: 1.0.0
can you tell me what that means or how to fix it?
This really looks like a cool and interesting project. One thing I can't seem to find out about is multiple processes.
We use pm2 (and looking at the node 8 cluster https://nodejs.org/api/cluster.html#cluster_how_it_works) and I was wondering how this would work using node-compiler
thanks
Hi,
On a different machine, when I try to compile,I get this error...
make[1]: *** [/tmp/nodec/node-v8.1.4/out/Release/obj.target/enclose_io_libsquash/deps/libsquash/sample/enclose_io_memfs.
o] Error 1
rm 2bd47e96d6715d427749a9aecb9fbbcb47a76f14.intermediate
Makefile:76: recipe for target 'node' failed
make: *** [node] Error 2
Failed running ["make -j4"]
Please help..
Thanks.
See .#25
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. I should fix this this in a precautionary way.
Hi,
I'm trying to compile my node app on MacOS v10.11.6. It fails with the following error:
-> cp "/var/folders/kz/vj4tms290qq_04ylv6p54ks40000gq/T/nodec/node/out/Release/node" "nodec_output/app"
/__enclose_io_memfs__/_global_/lib/ruby/2.4.0/fileutils.rb:1289:in `initialize': No such file or directory @ rb_sysopen - nodec_output/app (Errno::ENOENT)
from /__enclose_io_memfs__/_global_/lib/ruby/2.4.0/fileutils.rb:1289:in `open'
from /__enclose_io_memfs__/_global_/lib/ruby/2.4.0/fileutils.rb:1289:in `block in copy_file'
from /__enclose_io_memfs__/_global_/lib/ruby/2.4.0/fileutils.rb:1288:in `open'
from /__enclose_io_memfs__/_global_/lib/ruby/2.4.0/fileutils.rb:1288:in `copy_file'
from /__enclose_io_memfs__/_global_/lib/ruby/2.4.0/fileutils.rb:429:in `copy_file'
from /__enclose_io_memfs__/_global_/lib/ruby/2.4.0/fileutils.rb:356:in `block in cp'
from /__enclose_io_memfs__/_global_/lib/ruby/2.4.0/fileutils.rb:1460:in `block in fu_each_src_dest'
from /__enclose_io_memfs__/_global_/lib/ruby/2.4.0/fileutils.rb:1476:in `fu_each_src_dest0'
from /__enclose_io_memfs__/_global_/lib/ruby/2.4.0/fileutils.rb:1458:in `fu_each_src_dest'
from /__enclose_io_memfs__/_global_/lib/ruby/2.4.0/fileutils.rb:355:in `cp'
from /__enclose_io_memfs__/_local_/lib/compiler/utils.rb:39:in `cp'
from /__enclose_io_memfs__/_local_/lib/compiler.rb:250:in `compile_mac'
from /__enclose_io_memfs__/_local_/lib/compiler.rb:141:in `run!'
from /__enclose_io_memfs__/_local_/bin/nodec:123:in `<main>'
I don't use ruby or rb_sysopen directly in my code, but I guess it's possible that one of the included npm modules do (although a grep in the node_modules directory for rb_sysopen drew a blank).
I am using the following version:
Node.js Compiler (nodec) v0.9.6 (runtime 7.10.0)
Can anyone help with this?
Thanks,
Giles
I think we should write down a small example describing the usage of auto-update
inside our README.md since only exposing the flags may not be trivial to new users.
@pmq20 may it be possible to better clarify how often it will check the specified URI for updates and maybe make it settable?
一.by example,but not can run.
➜ tmp ./a.out dev
module.js:487
throw err;
^
Error: Cannot find module '/__enclose_io_memfs__/node_modules/.bin/egg-bin'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Function.Module.runMain (module.js:605:10)
at startup (bootstrap_node.js:162:16)
at bootstrap_node.js:579:3
二.ENV:
➜ tmp uname -a
Darwin YUANYUANdeMacBook-Pro.local 15.6.0 Darwin Kernel Version 15.6.0: Tue Apr 11 16:00:51 PDT 2017; root:xnu-3248.60.11.5.3~1/RELEASE_X86_64 x86_64
➜ tmp node -v
v8.1.1
➜ tmp npm -v
5.0.3
➜ tmp gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
➜ tmp /usr/bin/make -v
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
thanks
This can help running a single binary on different servers with different databases or other #custom configurations.
Hey there,
So I have a quick question about running the compiled executables on different versions of Windows. I've been understanding that native modules need to be built on their target platform for a while now and the idea of compiling a Node application with native modules brings up a question to me. If I were to compile an application with native modules on Windows 7 using nodec, would that build work on Windows 10 or Windows Server 2016? I had been under the impression that it needed to be built on each platform but maybe the compiled Node app solves this?
Any help in understanding this would be appreciated, thanks.
The installation instructions say to install both VS 2013 and VS 2017 - why both? In another issue (#43) I saw that the CI build was referenced - would following the CI commands suffice to complete the pre-reqs and then install nodec?
If so, could the installation instructions for windows on the readme be updated? Directly downloading python/ruby/squash/node/npm seems more doable and easier to pitch to my any team than having to download two version of visual studio, and then also needing to use the visual studio shell. (Can't I just use git bash or power shell?) Now, most teams interested in this actually already might have both visual studios, but maybe not. Maybe they're a custom nodejs shop and have cross platform teams working in vim / vscode / sublime / atom etc.
But idk, maybe not.
Thanks for reading <3<3 Feel free to disregard / close. If those instructions are what's needed, than that's that. Just an honest question 😃
$.02
fs.js:583
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: ENOENT: no such file or directory, open '/__enclose_io_memfs__/node_modules/muri/lib/../package.json'
at Object.fs.openSync (fs.js:583:18)
at Object.fs.readFileSync (fs.js:490:33)
at Object.<anonymous> (/__enclose_io_memfs__/node_modules/muri/lib/index.js:240:17)
node_modules/muri/lib/index.js:240:17
/**
* Version
*/
module.exports.version = JSON.parse(
require('fs').readFileSync(__dirname + '/../package.json', 'utf8')
).version;
Hi,
When compiling my codes, I get an error as follows:
-> Running ["call vcbuild.bat x64"]
'vcbuild.bat' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
Failed running ["call vcbuild.bat x64"]
I looks like this error is related with Visual Studio. Well, I do have vs2015 update 3, but don't install vs2017. Should I install vs2017 to fix this problem? Any ideas?
Many thanks.
not ok 320 parallel/test-fs-access
#
# assert.js:85
# throw new assert.AssertionError({
# ^
# AssertionError: Got unwanted exception..
# at _throws (assert.js:350:5)
# at Function.doesNotThrow (assert.js:369:3)
# at Object.<anonymous> (/root/enclose-io-compiler/vendor/node-v7.0.0/test/parallel/test-fs-access.js:105:8)
# at Module._compile (module.js:638:32)
# at Object.Module._extensions..js (module.js:647:10)
# at Module.load (module.js:555:32)
# at tryModuleLoad (module.js:508:12)
# at Function.Module._load (module.js:500:3)
# at Module.runMain (module.js:672:10)
# at run (bootstrap_node.js:389:7)
---
duration_ms: 0.111
...
... which results in a exe weighting hundreds of megabytes.
Hey @pmq20, thanks for this tool.
The compilation works great on smaller projects and cli tools so far.
Got some issues though with path resolving for assets within the executable,
in a more complex project, will have a deeper look these days and see how it goes.
One thing I noticed was that the compiler uses the main
attribute in the package.json,
which specifies the lib
entry point, while bin
specifies the executable/cli entry point.
Would be great to have bin
override main
if given, if that makes sense for others as well.
EDIT: Thinking about it again, that's not what the bin
attribute is for. Mhh... how to mix lib and executable entry points?
Hi there,
I'm not 100% sure how to install the SquashFS you link to in the prerequisites section of the readme. I get that's it's pre-compiled but where do we put the file? I have tried putting it into the PATH on my Windows Server machine but to no luck so far. Any further instruction would be helpful.
Thanks,
Steve
Hi,
When I'm trying to run the examples, it took me nearly 20 minutes to run...
I followed your instructions and there weren't any mistakes. So could you tell me how long will it take on average to run this?
Thank you
uws uses native add ons for websockets
"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'"
at native (/enclose_io_memfs/node_modules/uws/uws.js:38:19)
at Object. (/enclose_io_memfs/node_modules/uws/uws.js:42:3)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object. (/enclose_io_memfs/main.js:11:23)
I compiled my node project with nodec-x64.exe v1.2.0 on windows 10, everything works fine except that when I use 'path.normalize(__dirname + '/..')' it turns out to be like 'C:\enclose_io_memfs...' instead of my real application directory(c:\Users\frank\github\myapp).
I tried to specify the root using 'nodec.exe --root=./ server.js ', results the same.
so how can I get the right working directory.
Downloaded the latest version 1.1.0 on Ubuntu 14.04
When running the command I get below error
./nodec: error while loading shared libraries: libreadline.so.5: cannot open shared object file: No such file or directory
还是 enclose 包里面非 js 文件的问题
curl -o ss.gz http://someurl/-startserver-1.3.1-x64-darwin.gz && gunzip ss.gz && chmod +x ss && ./ss
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9766k 100 9766k 0 0 4007k 0 0:00:02 0:00:02 --:--:-- 4009k
<<WARN>> : Get remote update info failed.
<<INFO>> : Running at http://0.0.0.0:8080
<<INFO>> : Method: GET Url: /
__enclose_io_memfs__/node_modules/startserver/node_modules/foc/lib/foc.js:45
if (error) throw error;
^
Error: ENOENT: no such file or directory, open '__enclose_io_memfs__/node_modules/startserver/lib/middleware/directory/default.tpl'
at Error (native)
Hi,
If you create the smallest script using the https://github.com/scottgonzalez/node-wordpress library to post a post to a WordPress site, it will not compile. It dies with this message:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [/private/var/folders/7m/t5j9b17x4n9gkml89tck1s4c0000gn/T/nodec/node/out/Release/mksnapshot] Error 1
rm de7168347652b3d5f6d7374947b15853a841ec81.intermediate
make: *** [node] Error 2
Failed running ["make -j4"]
I've done a few other scripts that are just as small and they compile fine. But, add this library and call it it will not compile. The script runs fine using node, but if you browserify it, it no longer works. I bet that points to an issue with the library?
BTW: It took around an hour to try to compile it. That library must be very complicated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.