Coder Social home page Coder Social logo

packer's Introduction

Packer πŸ“¦

Packer is a npm module that allows you to package apps built with NodeGui or React NodeGui into a standalone executable. Packer works on Mac, Windows and Linux

This is a initial MVP release of the module.

On MacOS - Packer will output a dmg file

On Linux - Packer will output an AppImage which is something similar to a .app file in MacOS

On Windows - Packer outputs a folder containing the executable and all the dlls.

Currently if you need to produce a build you need to run the packer in different OS environments. That is, cross platform builds are not supported in this release.

Usage

  • First step is to install the packer as a dev dependency. You can do so by:

    npm install --save-dev @nodegui/packer

  • Next you can run the init command:

    npx nodegui-packer --init MyApp

    This will produce the deploy directory containing the template. You can modify this to suite your needs. Like add icons, change the name, description and add other native features or dependencies. Make sure you commit this directory.

  • Next you can run the pack command:

    npx nodegui-packer --pack <path to dist>

    This command essential takes the dist folder as the input and puts it in the suitable location inside the standalone executable. Also it runs the correct deployment tool (macdeployqt incase of mac, etc) and packs in the dependencies. The output of the command is found under the build directory. You should gitignore the build directory.

  • macOS supports signing the application:

    npx nodegui-packer --pack <path to dist>

How does it work ?

Packer uses Qt's packaging tools in all three platforms.

Requirements

  • Needs Qode v2.x (NodeGui v0.15.0 and up)

Future enhancements:

  1. Cross platform builds.
  2. Better documentation.
  3. Reduce / Remove unnecessary dynamic libraries.
  4. Reduce qode binary size.

Please feel free to help out with this in anyway you can.

packer's People

Contributors

a7ul avatar dependabot-preview[bot] avatar dooglio avatar liudonghua123 avatar qwqvictor avatar rgabs avatar tadaskay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

packer's Issues

Where is the dist folder?

I've run the npx nodegui-packer --init MyApp command, and I have a deploy directory, but then what do I do for the next command? That would be npx nodegui-packer --pack <path to dist>. Do I need to create an empty folder called dist? Or should It already be created from the init command?

Including Assets (images)

What is the correct way to include assets such as images in a Nodegui project, such that Packer can include them in the final packed app?

Obviously referencing an absolute local path won't work, and the method used in the Gif example (const iconImg = require('../assets/icon.png').default, and then const icon = new QIcon(path.resolve(__dirname, iconImg))) doesn't appear to be working for me, and Packer isn't moving the images to the final build folder.

When Requiring them, the images are added to Dist folder, but renamed such that they can't be resolved anymore.

Just wondering what the correct workflow is here. Thanks!

standalone executable on windows?

I have a working app almost ready but when trying to pack it instead of creating a standalone executable, a folder is created(deploy\win32\build\MyApp) with qode, dist folder and a bunch of .dlls.
The app works when executed like this but if I take the executable to another folder and run it, nothing happens.
I'm just using npx nodegui-packer --init MyApp and npx nodegui-packer --pack ./dist

Am I missing something?

Debugging after build of working code?

Hi

I've managed to build my app on MacOSX and it run using nom run fine but when I try 'open MyApp.app' it opens briefly then closes and shows a crash report that doesn't really give much away.

I used the console to cd into the MyApp.app/Contents/MacOS folder then then run ./qode but this just says:

 ./qode 
/Users/macbookair/Documents/nodejs/evermore-app/deploy/darwin/build/Evermore.app/Contents/Resources
objc[17686]: Class QMacAutoReleasePoolTracker is implemented in both /Users/macbookair/Documents/nodejs/evermore-app/node_modules/@nodegui/nodegui/miniqt/5.14.1/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x10613f030) and /Users/macbookair/Documents/nodejs/evermore-app/deploy/darwin/build/Evermore.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore (0x10b5e0030). One of the two will be used. Which one is undefined.
objc[17686]: Class QT_ROOT_LEVEL_POOL__THESE_OBJECTS_WILL_BE_RELEASED_WHEN_QAPP_GOES_OUT_OF_SCOPE is implemented in both /Users/macbookair/Documents/nodejs/evermore-app/node_modules/@nodegui/nodegui/miniqt/5.14.1/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x10613f0a8) and /Users/macbookair/Documents/nodejs/evermore-app/deploy/darwin/build/Evermore.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore (0x10b5e00a8). One of the two will be used. Which one is undefined.
objc[17686]: Class KeyValueObserver is implemented in both /Users/macbookair/Documents/nodejs/evermore-app/node_modules/@nodegui/nodegui/miniqt/5.14.1/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x10613f0d0) and /Users/macbookair/Documents/nodejs/evermore-app/deploy/darwin/build/Evermore.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore (0x10b5e00d0). One of the two will be used. Which one is undefined.
objc[17686]: Class RunLoopModeTracker is implemented in both /Users/macbookair/Documents/nodejs/evermore-app/node_modules/@nodegui/nodegui/miniqt/5.14.1/clang_64/lib/QtCore.framework/Versions/5/QtCore (0x10613f120) and /Users/macbookair/Documents/nodejs/evermore-app/deploy/darwin/build/Evermore.app/Contents/Frameworks/QtCore.framework/Versions/5/QtCore (0x10b5e0120). One of the two will be used. Which one is undefined.
qt.qpa.plugin: Could not load the Qt platform plugin "cocoa" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Prior to that I was getting "Cannot find module 'regenerator-runtime'" from qode so I npm installed the module which caused nodegui to rebuild.

Is there a preferred way of debugging these issues once things have been packed?

How to run the build artifacts?

After running packer on windows, I get the follwoing directory structure:

.
β”œβ”€β”€ config.json
└── win32
    β”œβ”€β”€ NvmGui
    β”‚   β”œβ”€β”€ platforms
    β”‚   β”œβ”€β”€ qode.json
    β”‚   └── styles
    └── build
        └── NvmGui
            β”œβ”€β”€ D3Dcompiler_47.dll
            β”œβ”€β”€ Qt5Core.dll
            β”œβ”€β”€ Qt5Gui.dll
            β”œβ”€β”€ Qt5Widgets.dll
            β”œβ”€β”€ dist
            β”‚   β”œβ”€β”€ 08ef36629f2fe40bdcbe135ae303d949.jpg
            β”‚   β”œβ”€β”€ index.js
            β”‚   └── nodegui_core-1adbd57cebe81664d2e1405d9c9f704f.node
            β”œβ”€β”€ imageformats
            β”‚   β”œβ”€β”€ qgif.dll
            β”‚   β”œβ”€β”€ qico.dll
            β”‚   └── qjpeg.dll
            β”œβ”€β”€ libEGL.dll
            β”œβ”€β”€ libGLESV2.dll
            β”œβ”€β”€ platforms
            β”‚   └── qwindows.dll
            β”œβ”€β”€ qode.exe
            β”œβ”€β”€ qode.json
            └── styles
                └── qwindowsvistastyle.dll

How do I run the application? I tried running qode.exe which did nothing, I also tried running qode.exe and passing the path of the built index.js file as an argument, this also did nothing.

Everything works fine in dev mode.

I'm new to QT and native development in general so my next question is how should I go about creating a windows installer, but I'm sure I can figure that out myself when I can run the application!

Where does linuxdeployqt.AppImage come from?

I get below error messages when running npx nodegui-packer --pack dist in nodegui-starter repo.

...
Error: spawn /home/soonoo/dev/nodegui-starter/node_modules/@nodegui/qode/dist/1.0.5/bin/linuxdeployqt.AppImage ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
...

I have to manually download linuxdeployqt executable from its repository and copy it to node_modules/@nodegui/qode/dist/1.0.5/bin/ before packing.
Is this intended?

System information:
OS: Arch Linux with kernel version 5.2.14
Node: 12.10.0
npm: 6.11.3

Question: After building a couple of times building is not possible.

Hello,
Somehow it stopped working, it may be that I changed something, it is the first time using nodegui for me.

How can I debug this better?

cleaning build directory at /Users/d.beeke/Development/phone-helper-nodegui/deploy/darwin/build
creating build directory at /Users/d.beeke/Development/phone-helper-nodegui/deploy/darwin/build
copying qode
copying dist
running macdeployqt
stderr: Log: Argument found: "-libpath=undefined"

stderr: Log: Using otool:

stderr: Log:  inspecting "/Users/d.beeke/Development/phone-helper-nodegui/deploy/darwin/build/PhoneHelper.app/Contents/MacOS/qode"

stderr: WARNING:

stderr: WARNING: Could not find any external Qt frameworks to deploy in "PhoneHelper.app"
WARNING: Perhaps macdeployqt was already used on "PhoneHelper.app" ?
WARNING: If so, you will need to rebuild "PhoneHelper.app" before trying again.

stderr: Log: Using strip:

stderr: Log:  stripped "/Users/d.beeke/Development/phone-helper-nodegui/deploy/darwin/build/PhoneHelper.app/Contents/MacOS/qode"

Build successful. Find the app at /Users/d.beeke/Development/phone-helper-nodegui/deploy/darwin/build

How to use this tool?

How to use this tool?

simplest package.json:

{
  "name": "banaur",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "qode ."
  },
  "author": "",
  "license": "",
  "dependencies": {
    "@nodegui/nodegui": "^0.37.3"
  }
}

all my code is a index.js:

const {
  QMainWindow,
  QWidget,
} = require('@nodegui/nodegui');

const win = new QMainWindow();
win.setWindowTitle('Password Generator');
win.resize(400, 200);

// Root view
const rootView = new QWidget();

win.setCentralWidget(rootView);
win.show();

global.win = win;

npx nodegui-packer --init MyAppName #generate display folder. I don't touch anything inside.

create a dist folder, then put all my code (just a index.js file) into this folder.

npx nodegui-packer --pack ./dist

result:

taye@taye-PC ~/Downloads/New folder (5)/d
Ξ» nnpx nodegui-packer --pack ./dist
cleaning build directory at C:\Users\taye\Downloads\New folder (5)\d\deploy\win32\build
creating build directory at C:\Users\taye\Downloads\New folder (5)\d\deploy\win32\build
copying qode
copying dist
running windeployqt
stderr: Please specify the binary or folder.
stdout: Usage: C:\Users\taye\Downloads\New folder (5)\d\node_modules\@nodegui\nodegui\miniqt\5.14.1\msvc2017_64\bin\windeployqt.exe [options] [files]
Qt Deploy Tool 5.14.1

The simplest way to use windeployqt is to add the bin directory of your Qt
installation (e.g. <QT_DIR\bin>) to the PATH variable and then run:
  windeployqt <path-to-app-binary>
If ICU, ANGLE, etc. are not in the bin directory, they need to be in the PATH
variable. If your application uses Qt Quick, run:
  windeployqt --qmldir <path-to-app-qml-files> <path-to-app-binary>

Options:
  -?, -h, --help            Displays help on commandline options.
  --help-all                Displays help including Qt specific options.
  -v, --version             Displays version information.
  --dir <directory>         Use directory instead of binary directory.
  --libdir <path>           Copy libraries to path.
  --plugindir <path>        Copy plugins to path.
  --debug                   Assume debug binaries.
  --release                 Assume release binaries.
  --pdb                     Deploy .pdb files (MSVC).
  --force                   Force updating files.
  --dry-run                 Simulation mode. Behave normally, but do not
                            copy/update any files.
  --no-patchqt              Do not patch the Qt5Core library.
  --no-plugins              Skip plugin deployment.
  --no-libraries            Skip library deployment.
  --qmldir <directory>      Scan for QML-imports starting from directory.
  --qmlimport <directory>   Add the given path to the QML module search
                            locations.
  --no-quick-import         Skip deployment of Qt Quick imports.
  --no-translations         Skip deployment of translations.
  --no-system-d3d-compiler  Skip deployment of the system D3D compiler.
  --compiler-runtime        Deploy compiler runtime (Desktop only).
  --no-virtualkeyboard      Disable deployment of the Virtual Keyboard.
  --no-compiler-runtime     Do not deploy compiler runtime (Desktop only).
  --webkit2                 Deployment of WebKit2 (web process).
  --no-webkit2              Skip deployment of WebKit2.
  --json                    Print to stdout in JSON format.
  --angle                   Force deployment of ANGLE.
  --no-angle                Disable deployment of ANGLE.
  --no-opengl-sw            Do not deploy the software rasterizer library.
  --list <option>           Print only the names of the files copied.
                            Available options:
                             source:   absolute path of the source files
                             target:   absolute path of the target files
                             relative: paths of the target files, relative
                                       to the target directory
                             mapping:  outputs the source and the relative
                                       target, suitable for use within an
                                       Appx mapping file
  --verbose <level>         Verbose level (0-2).

Qt libraries can be added by passing their name (-xml) or removed by passing
the name prepended by --no- (--no-xml). Available libraries:
bluetooth concurrent core declarative designer designercomponents enginio
gamepad gui qthelp multimedia multimediawidgets multimediaquick network nfc
opengl positioning printsupport qml qmltooling quick quickparticles quickwidgets
script scripttools sensors serialport sql svg test webkit webkitwidgets
websockets widgets winextras xml xmlpatterns webenginecore webengine
webenginewidgets 3dcore 3drenderer 3dquick 3dquickrenderer 3dinput 3danimation
3dextras geoservices webchannel texttospeech serialbus webview

Arguments:
  [files]                   Binaries or directory containing the binary.

stderr:


(node:11736) UnhandledPromiseRejectionWarning: child process exited with code 1
(node:11736) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11736) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

relative:
#112

...and I find out electron's doc is more user friendly to a newbie...

process crashes when I do literally anything

Hey again,

Just playing around with NodeGUI again, and noticed (more sort of ran into) some issues. NodeGUI can open a window, and that's about it. I can't open other modals like a file dialog, or add widgets to the main windows. I'm not sure what's going on here, but there isn't any helpful error message or anything apart from

qt.svg: /home/jcake/.config/Kvantum/Fluent-round/Fluent-roundDark.svg:7990: Could not resolve property: #paint0_linear
Notebook: symbol lookup error: /home/jcake/Code/Personal/Notebook/node_modules/.pnpm/@[email protected]/node_modules/@nodegui/nodegui/build/Release/nodegui_core.node: undefined symbol: _ZdlPvm, version Qt_5

I'm using a custom QT install (KDE BABBYYY), which has worked previously, for another NodeGUI project.

Any pointers on what I can do to try and debug this, that would be fantastic

Can't seem to build on windows

packer version 1.4.0
Tried to build it on macOS - work great

Move repo to windows, pack using windows instruction npx nodegui-packer --pack ./dist

  • node 13
  • latest nodegui

image

Did I miss anything?

AppImage run node REPL

Hi. I want to build and release this app:
https://github.com/thantez/ayahday.git

But neither on Linux nor on Windows 10 I can't get intended output. On Linux this packer will make a AppImage file, but this file isn't what I want! It can't run if graphically click on this file and by TTY it runs node REPL.

image

So I do this for packing on Linux:

git clone https://github.com/thantez/ayahday.git
yarn install
yarn start # to check it runs well or not
npx nodegui-packer --init AyahDay
yarn run build
npx nodegui-packer --pack ./dist

then it prints these logs:
https://pastebin.com/4xuTDJ6z

On window, I follow commands that mentioned before and output is like this issue:
#105 (comment)

P.S.: Everything works well when I just start to run project on development mode.
P.S.2: Versions of dependencies:

$ cmake --version                            

cmake version 3.21.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
$ gcc --version                 
gcc (GCC) 11.1.0
Copyright (C) 2021 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.
$ make --version       
GNU Make 4.3
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

and my Linux distro is this:

Linux thantez 5.14.7-arch1-1 #1 SMP PREEMPT Wed, 22 Sep 2021 21:35:11 +0000 x86_64 GNU/Linux

I'm not sure this works on Mac OS X 10.14

Hi,

I packed the nodegui starter project on Mac OS X 10.14, but when I tried to open the resulting app, I got an error message: "The application requires macOS 10.15 or later."

To reproduce:

git clone https://github.com/nodegui/nodegui-starter
cd nodegui-starter
npm run build
npm install @nodegui/packer
npx nodegui-packer --init starter
npx nodegui-packer --pack dist
cd deploy/darwin/build
open starter.app

The last command produces this error:

LSOpenURLsWithRole() failed with error -10825 for the file /Users/raf/repos/nodegui-starter/deploy/darwin/build/starter.app.

If I open the app in Finder, I get the message: "You can’t use this version of the application 'starter' with this version of macOS. You have macOS 10.14.1. The application requires macOS 10.15 or later."

Changing LSMinimumSystemVersion in Info.plist to 10.14 unfortunately doesn't seem to change anything.

Any ideas?

Question: QT licensing question

I personally don't like QT licensing headaches and the complexities involved in them.

I would like to create a closed-source, potentially commercial node-gui desktop app and use this to pack the app in a manner such that it can hopefully satisfy QT's LGPL licensing limitations.

Can I simply trust that the result of this packer can be distributed to potential customers without thinking about QT "stuff" and licensing?

Or do I still have to send my users a link and have them install QT by themselves?

packer stuck showing config file.

I used the npx nodegui-packer --init EAT to initial packer. Then I build the project and then ran the npx nodegui-packer --pack ./dist command.
I'm trying to build the Linux executable. Here are the following issues I'm facing:

  1. The packer stuck while showing the details of the .desktop file. Here is the screenshot.
    Screenshot from 2020-05-01 10-58-38
    It is stuck here for half and hour.

  2. While it is running, I tried running the executables created by double clicking them, they are not running. Below is the screenshot
    Screenshot from 2020-05-01 11-25-14

  3. I created symlink to .desktop file onto my desktop to run it. Still no luck.

Qode download is very slow

Downloading Qode v2.1.0 [========================------------------------------------------------------------------------------------] 22% of 11.40MB 880.5s

I've set http_proxy and https_proxy env variables while npm install. But it seems not working. Please support proxy.

Windows builds might require additional dependencies

Tried on official windows 10 VM for IE11 testing and some ordinary systems: qode.exe might require installed visual c++ redistributable 2019. Without it, qode.exe will just fail after showing console, with error loading native node extension (*.node in dist folder)

I used this link to update it: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

Is it possible to fix the missing dependency on packer level? Or maybe just to leave a note that this issue can happen?

Build error

Cannot find module '@nodegui/nodegui/config/qtConfig'
image
I've already tried to remove node_modules and reinstall it but nothing works...

Can't integrate dependencies with WASM modules

Hi, I have an app that requires the package gltf-transform to work. This package uses numerous wasm modules.

I configured copy-webpack-plugin so that the necessary wasm files are copied in the dist directory. The configuration of copy webpack plugin looks like this :

patterns: [
  {
    from: "*.wasm",
    context: "./node_modules/@squoosh/lib/build/"
  },
  "./node_modules/draco3d/draco_decoder.wasm",
  "./node_modules/draco3dgltf/draco_decoder_gltf.wasm",
  "./node_modules/draco3dgltf/draco_encoder.wasm",
],

Thus, I can properly launch the compiled app with node_modules/.bin/qode dist/index.js. My problem is that once compiled, the app will exit immediately after launch.

I am on MacOS Monterey 12.2.1, Intel CPU. I checked the MacOS console but could find nothing relevant.

To reproduce, simply use the nodegui-starter, add the gltf-transform dependency, add the line import { Mode, toktx as ktx } from '@gltf-transform/cli' to index.js (I made it JS to avoid TS problems at build time), add '.json' to resolve section of webpack config, and try compiling and packing.

wrong paths requested when packing (windows)

i tried packer on react-starter app with:

"pack": "nodegui-packer --init starterApp",
"postpack": "nodegui-packer --pack ./dist"

"@nodegui/nodegui": "^0.1.7",
"@nodegui/react-nodegui": "^0.1.5",
"@nodegui/packer": "^1.1.0",
"@nodegui/qode": "^1.0.4",

deleted \node_modules, \dist and ran npm install, npm run build and npm run pack

got a few errors, so i copied the files following the error messages and was able to pack,

first file not found was node_modules\@nodegui\qode\dist\1.0.4\windeployqt.exe
solved by copying contents from node_modules\@nodegui\qode\dist\1.0.4\bin\ to node_modules\@nodegui\qode\dist\1.0.4\,

next file node_modules\@nodegui\qode\dist\bin\Qt5Core.dll
solved copying \bin folder from node_modules\@nodegui\qode\dist\1.0.4\ to node_modules\@nodegui\qode\dist\

and then got stderr: Unable to find the platform plugin.
and i copied \plugins folder from node_modules\@nodegui\qode\dist\1.0.4\ to node_modules\@nodegui\qode\dist\

this file was also not found \node_modules\@nodegui\qode\dist\mkspecs\qconfig.pri but that didn't stop the packing

after these 3 steps the app was packed successfully,

i couldn't figure out how to fix it on packer script, so i hope this helps.

MacOSX codesign

Hi

I've added code signing as I'd like to distribute my app built with NodeGUI and I've come across and issue where I try to code sign the Application.app folder and I get the following error:

stderr: ERROR: Codesign signing error:
ERROR: "/Users/macbookair/Documents/nodejs/evermore-app/deploy/darwin/build/Evermore.app/Contents/MacOS/qode: code object is not signed at all\nIn subcomponent: /Users/macbookair/Documents/nodejs/evermore-app/deploy/darwin/build/Evermore.app/Contents/Frameworks/QtPrintSupport.framework\n"

I did this by enabling the packer to send the -codesign= option so I presume it sends this to the qt deploy program for MacOS?

It also the default install of MiniQT that installs with nodegui too

Any ideas?

Packed app on macos does not have signature.

After packing an app and downloading on a new device of the same kind, the packer app is "broken or damaged" and cannot be opened. Is there something I should be doing to fix this?

Cannot pack nodegui application

I've followed the 'Getting started' section on the NodeGUI website. I can run the program with commands through npm run run, but cannot package it with npx nodegui-packer --pack ./dist. It comes up with this error:

cleaning build directory at C:\Users\Dan\Documents\BabsLauncher\deploy\win32\build
creating build directory at C:\Users\Dan\Documents\BabsLauncher\deploy\win32\build
copying qode
copying dist
running windeployqt
stderr: Please specify the binary or folder.
stderr:

stdout: Usage: > C:\Users\Dan\Documents\BabsLauncher\node_modules@nodegui\nodegui\miniqt\6.4.1\msvc2019_64\bin\windeployqt.exe [options] > [files]
Qt Deploy Tool 6.4.1

The simplest way to use windeployqt is to add the bin directory of your Qt
installation (e.g. <QT_DIR\bin>) to the PATH variable and then run:
windeployqt

If your application uses Qt Quick, run:
windeployqt --qmldir

Options:
-?, -h, --help Displays help on commandline options.
--help-all Displays help including Qt specific options.
-v, --version Displays version information.
--dir Use directory instead of binary directory.
--qmake Use specified qmake instead of qmake from PATH.
Deprecated, use qtpaths instead.
--qtpaths Use specified qtpaths.exe instead of qtpaths.exe
from PATH.
--libdir Copy libraries to path.
--plugindir Copy plugins to path.
--debug Assume debug binaries.
--release Assume release binaries.
--pdb Deploy .pdb files (MSVC).
--force Force updating files.
--dry-run Simulation mode. Behave normally, but do not
copy/update any files.
--no-patchqt Do not patch the Qt6Core library.
--ignore-library-errors Ignore errors when libraries cannot be found.
--no-plugins Skip plugin deployment.
--no-libraries Skip library deployment.
--qmldir Scan for QML-imports starting from directory.
--qmlimport Add the given path to the QML module search
locations.
--no-quick-import Skip deployment of Qt Quick imports.
--translations A comma-separated list of languages to deploy
(de,fi).
--no-translations Skip deployment of translations.
--no-system-d3d-compiler Skip deployment of the system D3D compiler.
--compiler-runtime Deploy compiler runtime (Desktop only).
--no-virtualkeyboard Disable deployment of the Virtual Keyboard.
--no-compiler-runtime Do not deploy compiler runtime (Desktop only).
--json Print to stdout in JSON format.
--no-opengl-sw Do not deploy the software rasterizer library.
--list Print only the names of the files copied.
Available options:
source: absolute path of the source files
target: absolute path of the target files
relative: paths of the target files, relative
to the target directory
mapping: outputs the source and the relative
target, suitable for use within an
Appx mapping file
--verbose Verbose level (0-2).

Qt libraries can be added by passing their name (-xml) or removed by passing
the name prepended by --no- (--no-xml). Available libraries:
bluetooth concurrent core declarative designer designercomponents gamepad gui
qthelp multimedia multimediawidgets multimediaquick network nfc opengl
openglwidgets positioning printsupport qml qmltooling quick quickparticles
quickwidgets script scripttools sensors serialport sql svg svgwidgets test
websockets widgets winextras xml webenginecore webengine webenginewidgets 3dcore
3drenderer 3dquick 3dquickrenderer 3dinput 3danimation 3dextras geoservices
webchannel texttospeech serialbus webview shadertools uitools core5compat

Arguments:
[files] Binaries or directory containing the binary.

node:internal/process/promises:289
triggerUncaughtException(err, true /* fromPromise */);
^

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "child process exited with code 1".] {
code: 'ERR_UNHANDLED_REJECTION'
}

Node.js v20.12.2

This is my first time using NodeGUI and I cannot find this error online anywhere.

Missing integration tests

Would be cool to add a CI/CD pipeline for testing on different platforms, to make sure it'll pack and run a NodeGUI application on them all.
I can do this if you want.

Package for 32bit architecture

Hello, I was thrilled to see this project as an ex C++/Qt Developper (yeah started there and move to the web, NodeJS...)
But i read here that NodeGUI works only on 64bit OS, well that's fine, but what if my target consumers have mostly 32bit computers, will i be able to develop on my 64bit machine, and package it for both 32 and 64bit OS ?

I hope there's a way around either ways. Cause that was the last thing on my checklist before i can actually use this for my projects, πŸ™ˆ

Thanks!

Packed app won't run if there's a space in the file path

Using version 1.1.2. Easy to reproduce on Windows, haven't checked if this is an issue elsewhere.

Starting in c:/temp:

git clone https://github.com/nodegui/nodegui-starter
cd nodegui-starter
npm install
npm install --save-dev @nodegui/packer
npm run-script build
npx nodegui-packer --init MyApp
npx nodegui-packer --pack dist
cd deploy/win32/build/MyApp
./qode

Above all works fine and hello world app appears. Now to introduce a space in the path:

cd ..
mv MyApp "MyApp with spaces"
cd "MyApp with spaces"
./qode

Errors out in console before managing to load:

internal/modules/cjs/loader.js:628
    throw err;
    ^

Error: Cannot find module 'C:/temp/nodegui-starter/deploy/win32/build/MyApp'
Require stack:
- internal/preload
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:625:15)
    at Function.Module._load (internal/modules/cjs/loader.js:527:27)
    at Module.require (internal/modules/cjs/loader.js:683:19)
    at Module._preloadModules (internal/modules/cjs/loader.js:939:12)
    at loadPreloadModules (internal/bootstrap/pre_execution.js:392:5)
    at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:53:3)
    at internal/main/repl.js:18:1 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'internal/preload' ]

Seems specific to packer since renaming parent to c:/temp/nodegui starter and running npx qode ./dist/index.js from there works fine.

qt.conf in Ubuntu is being ignored

This issue is related to #177

This time I was using Ubuntu 22.04.3 Jammy , but when modified qt.conf as in issue #177 to run my app, was not working.

After that, I used

sudo QT_DEBUG_PLUGINS=1 ./AppRun

And then got

qt.core.plugin.factoryloader: checking directory path "/home/User/MyApp/deploy/linux/build/MyApp/platforms" ...

qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""

qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""

This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

I had to use the following command to run my app:

sudo QT_PLUGIN_PATH=~/MyApp/node_modules/@nodegui/nodegui/miniqt/6.4.1/gcc_64/plugins ./AppRun

I leave it here since it can be useful for anyone else.

'nodegui-packer@latest' is not in the npm registry?

Hi

Am seeing the following error when running npx nodegui-packer --init MyApp on my Macbook running High Sierra 10.13.6

`Cs-MacBook-Pro:react-nodegui-packer cabbott$ npx nodegui-packer --init MyApp
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/nodegui-packer - Not found
npm ERR! 404
npm ERR! 404 'nodegui-packer@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

Can see the package is in the npm registry here - https://registry.npmjs.org/@nodegui/packer

Here's the full error log. Thanks for your help.

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli '/usr/local/bin/node',
1 verbose cli '/usr/local/lib/node_modules/npm/bin/npm-cli.js',
1 verbose cli 'install',
1 verbose cli 'nodegui-packer@latest',
1 verbose cli '--global',
1 verbose cli '--prefix',
1 verbose cli '/Users/cabbott/.npm/_npx/59738',
1 verbose cli '--loglevel',
1 verbose cli 'error',
1 verbose cli '--json'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session c73c1d6e7a015d23
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 404 https://registry.npmjs.org/nodegui-packer 776ms
8 http fetch GET 404 https://registry.npmjs.org/nodegui-packer 665ms
9 silly fetchPackageMetaData error for nodegui-packer@latest 404 Not Found - GET https://registry.npmjs.org/nodegui-packer - Not found
10 timing stage:rollbackFailedOptional Completed in 0ms
11 timing stage:runTopLevelLifecycles Completed in 1460ms
12 verbose stack Error: 404 Not Found - GET https://registry.npmjs.org/nodegui-packer - Not found
12 verbose stack at /usr/local/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:104:15
12 verbose stack at processTicksAndRejections (internal/process/task_queues.js:97:5)
13 verbose statusCode 404
14 verbose pkgid nodegui-packer@latest
15 verbose cwd /Users/cabbott/Documents/GitRepos/react-nodegui-packer
16 verbose Darwin 17.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/bin/npm-cli.js" "install" "nodegui-packer@latest" "--global" "--prefix" "/Users/cabbott/.npm/_npx/59738" "--loglevel" "error" "--json"
18 verbose node v12.16.1
19 verbose npm v6.13.4
20 error code E404
21 error 404 Not Found - GET https://registry.npmjs.org/nodegui-packer - Not found
22 error 404
23 error 404 'nodegui-packer@latest' is not in the npm registry.
24 error 404 You should bug the author to publish it (or use the name yourself!)
`

Use appName for application title

Currently some customization is required to use a custom app name for the title in the generated executable.

For example in macOS the template/darwin/Contents/Info.plist values have to be edited appropriately.

The default.desktop file for linux, etc.

It would be great to use the appName and allow it to be passed via the CLI as well.

Can`t use "Open with"

Describe the bug
When trying to run application with files as attribute have a failure:

./App.-x86_64.AppImage /home/user/file.txt
PFS0
    ^

SyntaxError: Invalid or unexpected token
    at Object.compileFunction (vm.js:344:18)
    at wrapSafe (internal/modules/cjs/loader.js:1106:15)
    at Module._compile (internal/modules/cjs/loader.js:1140:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47

When I try to splice process.argv

const openedFiles = process.argv.splice(1);

Have an error:

./App.-x86_64.AppImage /home/user/file.txt
internal/validators.js:121
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
    at validateString (internal/validators.js:121:11)
    at Object.resolve (path.js:980:7)
    at resolveMainPath (internal/modules/run_main.js:12:40)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:65:24)
    at internal/main/run_main_module.js:17:47 {
  code: 'ERR_INVALID_ARG_TYPE'
}

Without packing to AppImage it work with splice 2 elements of process.argv:
const openedFiles = process.argv.splice(2);
npm start /home/user/file.txt

Cannot run on Linux

I am trying to run basic hello world app on Ubuntu 19.04. I am getting MODULE_NOT_FOUND error.
attaching the screenshot below. Is it duplicate of #29 ?

Steps to reproduce:

  • Cloned started repo with git clone https://github.com/nodegui/nodegui-starter
  • Ran yarn install to install deps
  • Installed packer with yarn add -D @nodegui/packer
  • Ran packer with yarn nodegui-packer --init MyApp

After that I immedietly got the error
2020-03-06_16-39

Here's pastebin of error just in case image is unreadable
https://bin.mkr.pw/~5e623131d91d063518915d63

Can't build on Linux

I get this error whenever I try to build my nodegui program:

~/Desktop/Minecraft/big-dub/ServerApp main*
❯ npm run build                                                   

> @ build /home/raphael/Desktop/Minecraft/big-dub/ServerApp
> tsc && nodegui-packer --pack ./dist

cleaning build directory at /home/raphael/Desktop/Minecraft/big-dub/ServerApp/deploy/linux/build
creating build directory at /home/raphael/Desktop/Minecraft/big-dub/ServerApp/deploy/linux/build
copying qode
copying dist
running linuxdeployqt
stderr: /usr/bin/AppImageLauncher: /home/raphael/Desktop/Minecraft/big-dub/ServerApp/node_modules/@nodegui/nodegui/miniqt/5.14.1/gcc_64/lib/libQt5Core.so.5: version `Qt_5.15' not found (required by /usr/bin/AppImageLauncher)

OS: Arch linux

The plugins path in qt.conf (linux mint) points to a non-existent folder (Bug)

Hello, i was testing my app in linux mint (linuxmint-21.1-cinnamon-64bit) with a Virtual machine, after the installation in the console wrote:

sudo apt install -y git
sudo apt-get install -y nodejs
sudo apt install -y cmake
sudo cd my-app
sudo npm install
sudo npm start

sudo npx nodegui-packer --init my-app
sudo npx nodegui-packer --pack dist

Then i tried to run the .AppImage with ./AppRun, but the console print:
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""

I used QT_DEBUG_PLUGINS=1 ./AppRun and got:
qt.core.plugin.factoryloader: checking directory path "/usr/lib/node_modules/my-app/deploy/linux/build/my-app/platforms"

The "platforms" folder does not exist, so i changed the path for plugins on qt.conf for /usr/lib/node_modules/@nodegui/nodegui/miniqt/6.4.1/gcc_64/plugins

All is working now, but since seems to be a bug, i wanted to make a post about it, have a good day/night.

Production qode.exe only running from some locations

I am using packer to package my application for win32, running qode.exe works in the build directory, however if I move the entire build folder, running qode.exe opens and closes instantly (although sometimes it lingers around for 10 seconds) - doesn't appear to be loading my index.js file from the dist folder.

What is strange is that if I move the folder to some locations, it will work. I tried running it from the C drive root, and this did not work. Which probably rules out 'spaces in pathname' theory which I first thought.

Very confused.

Is there a way I can see any error qode is producing before it dies? My app already pipes the stdout and stderr to log files, but I don't see these as it appears qode.exe is dying before getting to my code.

Update
It appears only to run if there is a package.json in a parent/grand parent folder

  • Ok, so there appears to be some requirement for a package.json, even an empty one

I'm an idiot

It appears the library 'conf' I'm using requires a package.json to exist. So compltely unreleated to qode. I'll close!

Duplicate window with process.fork()

Hi,

I don't know if the issue is related to packer or linuxdeployqt, so I try here.

I use node child process child_process.fork() in my program. I give a file path as input to choose which module to start in the child process. It works fine during npm run debug and npm start, but with the final packer build, it opens a new similar window and closes as soon as the process ends.

Is there a workaround or a fix for that ?

Thank you !

Running in Raspberry Pi

Hey there, not sure if nodegui is supported in Raspi, but I tried and it only outputs a file with weird name:
οΏ½F@@οΏ½οΏ½@8@

I tried to run it with nodejs but npm install fails with CMAKE errors.
Then I create a ubuntu VM on my mac and use packer to create an executable, the executable runs fine in ubuntu.

However the same executable does not have a response except creating a file with the name of οΏ½F@@οΏ½οΏ½@8@.

I noticed that nodegui has to run under 64 bit, i have enabled it on Raspbian, though 64bit support isn't very good in Raspbian currently.
Running uname -m outputs aarch64

Is this tool abandoned?

Even though the library is still active, I'm not seeing any active development on this tool. The devs aren't attending to issues either. I'd love to know before investing time in a new project dependent on NodeGui.

Packer can not distribute the macOS app

Hi,
I am using packer to deliver my application to another mac machine. After successful running the packer, my app can open and run.
However if I remove my dev node_modules, it failed to start without reason/error. If I get back my node_modules, it works again. So I guess the issue is about dynamic loading QT framework. How could I fix this? I would like to deliver my app outside my development mac.

build failing with node react-GUI

i was trying to pack my application for linux but it failed with this error message

{
cleaning build directory at /home/abhishek/Desktop/JS- Projects/rn-starter/deploy/linux/build
creating build directory at /home/abhishek/Desktop/JS- Projects/rn-starter/deploy/linux/build
copying qode
copying dist
running linuxdeployqt
stderr: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'

stderr: Failed to connect to bus: No such file or directory

stderr: Failed to connect to bus: No such file or directory

stdout: Failed to connect to bus: No such file or directory

stdout: Failed to connect to bus: No such file or directory

(node:11841) UnhandledPromiseRejectionWarning: child process exited with code 1
(node:11841) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11841) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
}

OS:- kde neon

packer version-: "@nodegui/packer": "^1.3.0"

help!

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.