Coder Social home page Coder Social logo

nodegui / qode Goto Github PK

View Code? Open in Web Editor NEW
91.0 91.0 10.0 1.33 MB

DEPRECATED: Please see https://github.com/nodegui/qodejs instead

Home Page: https://nodegui.github.io/nodegui/#/tutorial/application-architecture?id=qode

JavaScript 0.86% Python 1.94% C++ 96.86% Objective-C++ 0.20% Shell 0.14%
desktop gui nodejs qode qt react-desktop

qode's Introduction

NodeGui

All Contributors JS Party #96 Build and Test status Discuss on GitHub

Build performant, native and cross-platform desktop applications with Node.js and CSS like styling.πŸš€

NodeGUI is powered by Qt6 πŸ’š which makes it CPU and memory efficient as compared to other chromium based solutions like Electron.

If you are looking for React based version, check out: React NodeGUI.

If you are looking for Vue based version, check out: Vue NodeGUI.

If you are looking for Svelte based version, check out: Svelte NodeGUI

Visit https://nodegui.github.io/nodegui for docs.

logo

How does it look?

demo_linux demo_win demo_mac
kitchendemo_macdemo_win

Code Examples

https://github.com/nodegui/examples


Features

  • 🧬 Cross platform. Works on major Linux flavours, Windows, and MacOS.
  • πŸ“‰ Low CPU and memory footprint. Current CPU stays at 0% on idle and memory usage is under 20MB for a Hello World program.
  • πŸ’… Styling with CSS (includes actual cascading). Also has full support for Flexbox layout (thanks to Yoga).
  • βœ… Complete Nodejs API support (Currently runs on Node v16.x - and is easily upgradable). Hence has access to all Nodejs compatible NPM modules.
  • πŸŽͺ Native widget event listener support. Supports all events available from Qt / NodeJs.
  • πŸ’Έ Can be used for Commercial applications.
  • πŸ•΅οΈβ€β™‚οΈ Good Devtools support.
  • πŸ“š Good documentation and website.
  • πŸ§™β€β™‚οΈ Good documentation for contributors.
  • πŸ¦ΉπŸ»β€β™€οΈ Good support for dark mode (Thanks to Qt).
  • πŸ…First class Typescript support. (Works on regular JS projects too πŸ˜‰).

Getting Started

Installation

To install latest stable release:

npm install @nodegui/nodegui

To install the latest version available on master branch:

npm install https://github.com/nodegui/nodegui/releases/download/v0.0.0-latest-master/nodegui-master.tgz

or a shorter version:

npm i http://master-release.nodegui.org

If the installation fails to download the Qt binaries, a mirror can be used by setting the following environment variable and running the install command again:

QT_LINK_MIRROR=<alternative domain> # eg. QT_LINK_MIRROR=https://qt-mirror.dannhauer.de

npm install @nodegui/nodegui

See FAQs for more details.

Community guides

Talks/Podcasts

Docs for contributing

It is easier than you think, try it

Looking to contribute? If you wish to implement a new widget/add more features and need help understanding the codebase, you can start here: Contributing developer docs.

Please read https://github.com/nodegui/.github/blob/master/CONTRIBUTING.md

Building from source

This section is useful for those wanting to work on NodeGui itself.

Required tooling

NodeGui requires CMake and Compilation Tools as it is a wrapper for a native C++ widget toolkit QT. Detailed instructions here: https://www.sitepoint.com/build-native-desktop-gif-searcher-app-using-nodegui/

TL;DR:

MacOS

brew install cmake
brew install make

Windows

https://cmake.org/download/

Linux (Debian/Ubuntu)

sudo apt-get install pkg-config build-essential
sudo apt-get install cmake make
sudo apt-get install mesa-common-dev libglu1-mesa-dev

Linux (Fedora/RHEL/CentOS)

sudo dnf groupinstall "Development Tools" "Development Libraries"
sudo dnf groupinstall "C Development Tools and Libraries"
sudo dnf install mesa-libGL mesa-libGL-devel

Building

Once you have cloned this git repository, run this to build:

npm install
npm run build

The last step will takes some time to run as it builds the C++ binaries at the core of NodeGui.

Using your own custom Qt installation (Optional)

Compiling Qt from source

You will need to download and install Qt from source since there are no binaries from Qt for M1 yet.

(https://www.reddit.com/r/QtFramework/comments/ll58wg/how_to_build_qt_creator_for_macos_arm64_a_guide/)

git clone git://code.qt.io/qt/qt5.git qt6
cd qt6
git checkout 6.6

./init-repository --module-subset=essential -f
git submodule init qtsvg
git submodule update qtsvg

cd ..
mkdir qt6-6.6-macOS-release
cd qt6-6.6-macOS-release

../qt6/configure -release QMAKE_APPLE_DEVICE_ARCHS=arm64 -opensource -confirm-license -nomake examples -nomake tests -skip qt3d -skip webengine -skip qtactiveqt -skip qtcanvas3d  -skip qtdeclarative -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtcharts -skip qtgraphicaleffects -skip qtlocation  -skip qtpurchasing -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtvirtualkeyboard -skip qtscript

make -j15

make install

This should install Qt into something like this /usr/local/Qt-6.6.0 (your directory can change. This will be displayed when running make)

Pointing nodegui to use your custom Qt installation

Now just set export QT_INSTALL_DIR=<your qt path> . In the above example it would look something like this export QT_INSTALL_DIR=/usr/local/Qt-6.6.0. Add this in your .zshrc or .bashrc so that you dont need to repeat this process again.

Now just rm -rf node_modules and do npm install again.

The logs should say something like CustomQt detected at <your qt path>. Hence, skipping Mini Qt installation.

Running example programs

A number of small programs to show different parts of the Qt API are in src/examples. They can be run directly with:

npm run qode dist/examples/modelview_1_readonly.js

Updating docs

npm run docs

then followed by:

cd website && GIT_USER=<your_git_username> yarn deploy

Funding

NodeGui is an open source project and requires your support. If you like this project, please consider supporting my work by clicking on the Sponsor button on this Github repository or via Ko-Fi. Alternatively, Issues on NodeGui can be funded by anyone via Issuehunt and the amount will be distributed to respective contributors.

Buy Me a Coffee at ko-fi.com Β  Β issuehunt

Special Thanks

Code of Conduct

https://github.com/nodegui/.github/blob/master/CODE_OF_CONDUCT.md

License

MIT

Backers πŸš€

Thanks goes to these wonderful people.

Yuriy Yazlovytskyy
Yuriy Yazlovytskyy
John Susek
John Susek
Marc Dijoux
Marc Dijoux
Stephen Belanger
Stephen Belanger
Rustam
Rustam

Maintainers ✨

People maintaining this project.

Atul R
Atul R
Simon Edwards
Simon Edwards

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Lucas Ramage

πŸ“–

Denis Sikuler

πŸ“–

Nahuel JosΓ©

πŸ’¬

Kakul Gupta

πŸ’»

Rahul Gaba

πŸ’»

PaweΕ‚ Borecki

πŸ’»

Marcus S. Abildskov

⚠️

Átila Camurça Alves

πŸ“–

James Hibbard

πŸ’»

Soonwoo Hong

πŸ’»

Roy Sommer

πŸ’»

Paulo Coghi

πŸ€”

Balthild Ires

πŸ’»

Dimitar Nestorov

πŸ’»

Mikko Sairio

πŸ’»

Pepijn

πŸ’»

slidinghotdog

πŸ’»

Bundyo (Kamen Bundev)

πŸ’»

feng8848

πŸ’»

Maksim Karelov

πŸ’»

mspencer92

πŸ’»

blncd2020

πŸ“–

gluaxspeed

πŸ’»

Solant

πŸ’»

Shubham Zanwar

πŸ’»

Singha360

πŸ’»

Mihkel

πŸ’»

Stephen A

πŸ’»

桁君酱

πŸ’»

Adam Gastineau

πŸ’»

swittk

πŸ’»

craftingmod

πŸ’»

Doug Barbieri

πŸ’»

HENRIQUE DE SOUZA NERY

πŸ’»

Ruslan Garifullin

πŸ’»

Ranieri

πŸ’» πŸ“–

Nathanael Anderson

πŸ’»

Ross

πŸ’» πŸ“–

4h7l

πŸ’»

Maks

πŸ’»

zhb124404

πŸ“–

Wyatt Kirby

πŸ’»

Steven Koch

πŸ’»

Simon Edwards

πŸ’»

This project follows the all-contributors specification. Contributions of any kind welcome!

qode's People

Contributors

a7ul avatar azure-pipelines[bot] avatar dym-sh avatar markrocket avatar zcbenz 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

qode's Issues

Python cant open file 'configure'

linux fedora 30 os
`python: can't open file 'configure': [Errno 2] No such file or directory
child_process.js:660
throw err;
^

Error: Command failed: python configure --dest-cpu=x64
at checkExecSyncError (child_process.js:621:11)
at Object.execSync (child_process.js:657:15)
at execSync (/home/maxim/Desktop/work/qode/build.js:13:35)
at Object. (/home/maxim/Desktop/work/qode/build.js:82:1)
at Module._compile (internal/modules/cjs/loader.js:936:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:947:10)
at Module.load (internal/modules/cjs/loader.js:790:32)
at Function.Module._load (internal/modules/cjs/loader.js:703:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
at internal/main/run_main_module.js:17:11 {
status: 2,
signal: null,
output: [ null, null, null ],
pid: 12609,
stdout: null,
stderr: null
}
`

dynamic imports never resolve, iff you import anything from @nodegui/nodegui in the script doing the importing

Version information:

node: 16.0.0
qode: 14.17.0
yarn: 1.22.4
npm:  7.10.0

Screen Shot 2021-07-21 at 21 54 13

reproduction steps:

  • set your package.json to have "type": "module"

test.js

import { QMainWindow } from '@nodegui/nodegui';
import('./imported.js').then(console.log).catch(console.log);

imported.js

export const test = 5;

qode test.js

And you will get no output. However, if you remove line 1 from test.js, suddenly everything works as intended. Swapping the order also is seemingly irrelevant, the error persists whether i try to do the dynamic load first or not. Even when attempting to use top level await to force the dynamic import to happen before the static import.

Windows: remove openssl-no-asm flag

Currently we are building with --openssl-no-asm for windows.
See build.js.
execSync(`python configure --openssl-no-asm --dest-cpu=${target_arch}`, { cwd: "node" });

This is because we have issues with nasm for windows. See here: https://github.com/nodejs/node/blob/master/BUILDING.md#windows

This causes a warning

WARNING: --openssl-no-asm will result in binaries that do not take advantage                                                     of modern CPU cryptographic instructions and will therefore be slower.                                                  Please refer to BUILDING.md   

Hence need to fix this.
Make sure this can be made to work in CI also.

Errors while building on Windows 10

I cloned the repo and made sure the git submodules have been synced. However, I get these error messages when running node build.js:

Env variable: HOST_ARCH not specified, using default: x64
Node.js configure: Found Python 2.7.15...
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCLinkerTool/ImageHasSafeExceptionHandlers
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: unrecognized setting VCCLCompilerTool/MultiProcessorCompilation
Warning: Missing input files:
tools\msvs\genfiles\node_etw_provider.rc
tools\msvs\genfiles\node_etw_provider.h
INFO: configure completed successfully
Traceback (most recent call last):
  File "tools/gyp/gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "tools/gyp\pylib\gyp\__init__.py", line 554, in script_main
    return main(sys.argv[1:])
  File "tools/gyp\pylib\gyp\__init__.py", line 547, in main
    return gyp_main(args)
  File "tools/gyp\pylib\gyp\__init__.py", line 523, in gyp_main
    options.duplicate_basename_check)
  File "tools/gyp\pylib\gyp\__init__.py", line 107, in Load
    generator.CalculateVariables(default_variables, params)
  File "tools/gyp\pylib\gyp\generator\ninja.py", line 1697, in CalculateVariables
    gyp.msvs_emulation.CalculateCommonVariables(default_variables, params)
  File "tools/gyp\pylib\gyp\msvs_emulation.py", line 1094, in CalculateCommonVariables
    msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags)
  File "tools/gyp\pylib\gyp\msvs_emulation.py", line 945, in GetVSVersion
    allow_fallback=False)
  File "tools/gyp\pylib\gyp\MSVSVersion.py", line 504, in SelectVisualStudioVersion
    raise ValueError('Could not locate Visual Studio installation.')
ValueError: Could not locate Visual Studio installation.
child_process.js:669
    throw err;
    ^

Error: Command failed: python tools/gyp/gyp_main.py ../qode.gyp -f ninja -Dhost_arch=x64 -Dtarget_arch=x64 -I../config/node_overrides.gypi --depth .
    at checkExecSyncError (child_process.js:630:11)
    at Object.execSync (child_process.js:666:15)
    at execSync (C:\Users\Singha360\Desktop\qode\build.js:13:35)
    at Object.<anonymous> (C:\Users\Singha360\Desktop\qode\build.js:46:1)
    at Module._compile (internal/modules/cjs/loader.js:1156:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 5228,
  stdout: null,
  stderr: null
}

I do have Visual Studio Community 2019 with Desktop development with C++ installed. Python 2.7.15 was installed along when I ran npm install --global windows-build-tools

OS: Windows 10 1909

Question: What's wrong with my env?

Hi. First of all thanks for such interesting idea! πŸš€

I just stuck with small issue when trying out starter project (https://docs.nodegui.org/docs/guides/tutorial/#trying-out-the-starter-project)

When I running npm start webpack works well, but then I don't see any window. I see qode application in the Dock, but not window.

Probably I miss something. Could you help me with that, please?
Thanks!

Env:
OS: MacOS Catalina v10.15.3

$ node -v
v10.17.0
$ npm -v
6.13.0
$ npm list @nodegui/qode
[email protected] /Users/nb-078-11b/projects/nodegui-starter
└─┬ @nodegui/[email protected]
  └── @nodegui/[email protected] 

qode.exe run error in chinese path?

qode not support utf-8 path?

$ ./qode.exe
internal/modules/cjs/loader.js:1023
  throw err;
  ^

Error: Cannot find module 'H:\cloud-music-nodegui\deploy\win32\build\οΏ½οΏ½οΏ½οΏ½οΏ½οΏ½\dist'
Require stack:
- internal/preload
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:1020:15)
    at Function.Module._load (internal/modules/cjs/loader.js:890:27)
    at Module.require (internal/modules/cjs/loader.js:1080:19)
    at Module._preloadModules (internal/modules/cjs/loader.js:1321:12)
    at loadPreloadModules (internal/bootstrap/pre_execution.js:439:5)
    at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:71:3)
    at internal/main/eval_stdin.js:17:1 {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ 'internal/preload' ]
}

npm install fails

Issue

for qode - the npm install @nodegui/qode command fails

Environment Details:

ericmoore@cem mdview-nodegui % sw_vers                           
ProductName:	macOS
ProductVersion:	11.2.2
BuildVersion:	20D80

ericmoore@cem mdview-nodegui % uname -a
Darwin cem.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64

ericmoore@cem mdview-nodegui % sysctl -n machdep.cpu.brand_string
Intel(R) Core(TM) i7-4558U CPU @ 2.80GHz

ericmoore@cem mdview-nodegui % python3 --version                                   
Python 3.9.2

ericmoore@cem mdview-nodegui % python --version                  
Python 2.7.16

ericmoore@cem mdview-nodegui % gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

ericmoore@cem mdview-nodegui % clang --version
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin20.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

ericmoore@cem mdview-nodegui % cmake --version 
cmake version 3.20.0-rc4

CMake suite maintained and supported by Kitware (kitware.com/cmake).

Error Report

npm install @nodegui/qode

ericmoore@cem mdview-nodegui % npm install @nodegui/qode
npm ERR! code 1
npm ERR! path /Users/ericmoore/Web/mdview-nodegui/node_modules/@nodegui/nodegui
npm ERR! command failed
npm ERR! command sh -c cross-env node ./scripts/skip.js || npm run prebuild:install || npm run build:addon
npm ERR! > @nodegui/[email protected] prebuild:install
npm ERR! > prebuild-install --backend=cmake-js --runtime=napi --verbose
npm ERR! 
npm ERR! 
npm ERR! > @nodegui/[email protected] build:addon
npm ERR! > cross-env CMAKE_BUILD_PARALLEL_LEVEL=8 cmake-js compile
npm ERR! 
npm ERR! [
npm ERR!   '/Users/ericmoore/.nvm/versions/node/v12.18.0/bin/node',
npm ERR!   '/Users/ericmoore/Web/mdview-nodegui/node_modules/.bin/cmake-js',
npm ERR!   'compile'
npm ERR! ]
npm ERR! Not searching for unused variables given on the command line.
npm ERR! -- The C compiler identification is AppleClang 12.0.0.12000032
npm ERR! -- The CXX compiler identification is AppleClang 12.0.0.12000032
npm ERR! -- Detecting C compiler ABI info
npm ERR! -- Detecting C compiler ABI info - done
npm ERR! -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
npm ERR! -- Detecting C compile features
npm ERR! -- Detecting C compile features - done
npm ERR! -- Detecting CXX compiler ABI info
npm ERR! -- Detecting CXX compiler ABI info - done
npm ERR! -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
npm ERR! -- Detecting CXX compile features
npm ERR! -- Detecting CXX compile features - done
npm ERR! -- Configuring done
npm ERR! Not searching for unused variables given on the command line.
npm ERR! -- The C compiler identification is AppleClang 12.0.0.12000032
npm ERR! -- The CXX compiler identification is AppleClang 12.0.0.12000032
npm ERR! -- Detecting C compiler ABI info
npm ERR! -- Detecting C compiler ABI info - done
npm ERR! -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
npm ERR! -- Detecting C compile features
npm ERR! -- Detecting C compile features - done
npm ERR! -- Detecting CXX compiler ABI info
npm ERR! -- Detecting CXX compiler ABI info - done
npm ERR! -- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
npm ERR! -- Detecting CXX compile features
npm ERR! -- Detecting CXX compile features - done
npm ERR! -- Configuring done
npm ERR! prebuild-install info begin Prebuild-install version 5.3.3
npm ERR! prebuild-install info install installing standalone, skipping download.
npm ERR! info TOOL Using Unix Makefiles generator.
npm ERR! info CMD CONFIGURE
npm ERR! info RUN cmake "/Users/ericmoore/Web/mdview-nodegui/node_modules/@nodegui/nodegui" --no-warn-unused-cli -G"Unix Makefiles" -DCMAKE_JS_VERSION="6.0.0" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="/Users/ericmoore/Web/mdview-nodegui/node_modules/@nodegui/nodegui/build/Release" -DCMAKE_JS_INC="/Users/ericmoore/.cmake-js/node-x64/v12.18.0/include/node;/Users/ericmoore/Web/mdview-nodegui/node_modules/nan" -DCMAKE_JS_SRC="" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="12.18.0" -DNODE_ARCH="x64" -DCMAKE_CXX_FLAGS="-D_DARWIN_USE_64_BIT_INODE=1 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DBUILDING_NODE_EXTENSION" -DCMAKE_SHARED_LINKER_FLAGS="-undefined dynamic_lookup"
npm ERR! internal/modules/cjs/loader.js:969
npm ERR!   throw err;
npm ERR!   ^
npm ERR! 
npm ERR! Error: Cannot find module '@nodegui/qode'
npm ERR! Require stack:
npm ERR! - /Users/ericmoore/Web/mdview-nodegui/node_modules/@nodegui/nodegui/[eval]
npm ERR!     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
npm ERR!     at Function.Module._load (internal/modules/cjs/loader.js:842:27)
npm ERR!     at Module.require (internal/modules/cjs/loader.js:1026:19)
npm ERR!     at require (internal/modules/cjs/helpers.js:72:18)
npm ERR!     at [eval]:1:1
npm ERR!     at Script.runInThisContext (vm.js:120:20)
npm ERR!     at Object.runInThisContext (vm.js:311:38)
npm ERR!     at Object.<anonymous> ([eval]-wrapper:10:26)
npm ERR!     at Module._compile (internal/modules/cjs/loader.js:1138:30)
npm ERR!     at evalScript (internal/process/execution.js:94:25) {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: [
npm ERR!     '/Users/ericmoore/Web/mdview-nodegui/node_modules/@nodegui/nodegui/[eval]'
npm ERR!   ]
npm ERR! }
npm ERR! CMake Error: AUTOMOC for target nodegui_core: The "moc" executable "/bin/moc" does not exist.
npm ERR! CMake Generate step failed.  Build files cannot be regenerated correctly.
npm ERR! info REP Build has been failed, trying to do a full rebuild.
npm ERR! info CMD CLEAN
npm ERR! info RUN cmake -E remove_directory "/Users/ericmoore/Web/mdview-nodegui/node_modules/@nodegui/nodegui/build"
npm ERR! info CMD CONFIGURE
npm ERR! info RUN cmake "/Users/ericmoore/Web/mdview-nodegui/node_modules/@nodegui/nodegui" --no-warn-unused-cli -G"Unix Makefiles" -DCMAKE_JS_VERSION="6.0.0" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_LIBRARY_OUTPUT_DIRECTORY="/Users/ericmoore/Web/mdview-nodegui/node_modules/@nodegui/nodegui/build/Release" -DCMAKE_JS_INC="/Users/ericmoore/.cmake-js/node-x64/v12.18.0/include/node;/Users/ericmoore/Web/mdview-nodegui/node_modules/nan" -DCMAKE_JS_SRC="" -DNODE_RUNTIME="node" -DNODE_RUNTIMEVERSION="12.18.0" -DNODE_ARCH="x64" -DCMAKE_CXX_FLAGS="-D_DARWIN_USE_64_BIT_INODE=1 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DBUILDING_NODE_EXTENSION" -DCMAKE_SHARED_LINKER_FLAGS="-undefined dynamic_lookup"
npm ERR! internal/modules/cjs/loader.js:969
npm ERR!   throw err;
npm ERR!   ^
npm ERR! 
npm ERR! Error: Cannot find module '@nodegui/qode'
npm ERR! Require stack:
npm ERR! - /Users/ericmoore/Web/mdview-nodegui/node_modules/@nodegui/nodegui/[eval]
npm ERR!     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
npm ERR!     at Function.Module._load (internal/modules/cjs/loader.js:842:27)
npm ERR!     at Module.require (internal/modules/cjs/loader.js:1026:19)
npm ERR!     at require (internal/modules/cjs/helpers.js:72:18)
npm ERR!     at [eval]:1:1
npm ERR!     at Script.runInThisContext (vm.js:120:20)
npm ERR!     at Object.runInThisContext (vm.js:311:38)
npm ERR!     at Object.<anonymous> ([eval]-wrapper:10:26)
npm ERR!     at Module._compile (internal/modules/cjs/loader.js:1138:30)
npm ERR!     at evalScript (internal/process/execution.js:94:25) {
npm ERR!   code: 'MODULE_NOT_FOUND',
npm ERR!   requireStack: [
npm ERR!     '/Users/ericmoore/Web/mdview-nodegui/node_modules/@nodegui/nodegui/[eval]'
npm ERR!   ]
npm ERR! }
npm ERR! CMake Error: AUTOMOC for target nodegui_core: The "moc" executable "/bin/moc" does not exist.
npm ERR! CMake Generate step failed.  Build files cannot be regenerated correctly.
npm ERR! ERR! OMG Process terminated: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/ericmoore/.npm/_logs/2021-03-11T18_08_26_752Z-debug.log

related to:

Support global or root-user installations on Linux

Any attempt to install the qode npm package as the super user fails.

npm install -g @nodegui/qode fails to run with Error while setting up Qode { [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/@nodegui/qode/dist']

cd /root && npm install @nodegui/qode fails with Cannot find module '/root/node_modules/@nodegui/qode/install.js'

cd /home/some_user/Desktop/some_folder && npm install @nodegui/qode fails with Failed at the @nodegui/[email protected] postinstall script.

Running npm install @nodegui/qode in any other folder as a non-super-user works.

System Information:

  • Linux Mint 19 AMD64
  • npm 6.13.6

Cache downloaded resources

Can the downloaded resources be cached instead of being redownloaded every time on installation? e.g. Electron

The resources are quite large for poor network connections, e.g. in mainland China, so I guess we could have much better developer experience if we don't have to wait for the downloading progress every time a new project is started or dependencies are reinstalled.

armv7l release

Hi, I built nodegui-starter on Linux and Windows without problem. I then tried on a reMarkable 1, a Linux device with a 1 GHz ARM A9 CPU with entware and its own community supported package manager and repository allowing we to use node and npm. Unfortunately when npm install tried to add qode it failed to get the release for this architecture. Supporting this architecture would open up a lot potential for novel apps on this great device which unfortunately doesn't have a browser. How can I help with that?

Win32 support

Hi, first of all thanks for this great work! I'm looking at Nodegui for a desktop app I need to build for Win32 machines.

I know Qode currently supports Win64 only, but would it be possible it to support Win32 with some work?

If possible, I'd like to give it a try.

Thanks in advance.

Can only run qode via npm script?

I'm trying to understand how qode is running via an npm script. I.e: npm start.

Opening a command window in my project and typing qode yields a 'executable not found error'.
Do actions executed via npm have access to some extra path?

Update

I understand now, qode is made available via the /node_modules/.bin/ folder, which I presume is why it runs via npm scripts! Closing.

support for ia32 or arm64 on windows

Would it be possible to add support for either building for ia32 or arm64 for Windows 10? The new arm64 windows machines like Microsoft Surface Pro X can't run x64 binaries.

Proposal: headless mode

We need a CLI flag for specifying a headless mode (much like how it works in Chrome)

We need a way to programmatically instantiate an application without a GUI, so that we can create custom test environments for e.g Jest

Related to nodegui/nodegui#37

Micro tasks being run manually

The current version of Qode
has to run microtasks manually after every uv_run
43c8a33

Ideally it should be executed by node automatically.

This issue happens after upgrading to node v13

Microtasks work correctly when node_integration is removed.

This works for now due to the hack fix but need to be fixed in future.

In order to test this:

Download the v2.0.3 of qode (one without the above commit)

and run the following script by
./qode test.js

setInterval(() => {
    console.log('REACHED HERE');
    Promise.resolve(true).then(() => console.log('REACHED PROMISE CALLBACK'));
}, 2000);

setImmediate(() => {
    console.log('IMMEDIATELY');
});

qode.exe can't be renamed after packaging?

if rename to other name, it will get some error as follow:

$ ./a.exe
internal/modules/cjs/loader.js:1226
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The specified module could not be found.
\\?\H:\cloud-music-nodegui\deploy\win32\build\music\dist\nodegui_core-7c7efccfbf9f07e96c6307682942859c.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1226:18)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Module.require (internal/modules/cjs/loader.js:1080:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (H:\cloud-music-nodegui\deploy\win32\build\music\dist\index.js:6:8607)
    at n (H:\cloud-music-nodegui\deploy\win32\build\music\dist\index.js:1:110)
    at Object.<anonymous> (H:\cloud-music-nodegui\deploy\win32\build\music\dist\index.js:1:1001)
    at n (H:\cloud-music-nodegui\deploy\win32\build\music\dist\index.js:1:110)
    at Object.<anonymous> (H:\cloud-music-nodegui\deploy\win32\build\music\dist\index.js:1:1317)

Starting qode when user logs into windows?

I've build my app and it works fine when installed to the C:\Programs Files (x86) folder and I double click it.

However, I added it to the startup section so it would star when the user logs in and it wont start. Its code signed with my EV certificate so its not getting flagged as a virus etc. What else could be stopping it ?

Add node version correspondance

hi,

thanks for your work,

can you add a correspondence table qode -> node so for module that rely on node-pre-gyp, it can be build with the correct version

thanks

windows10 build failed

[2916/2916] LINK_EMBED qode.exe
FAILED: qode.exe qode.exe.pdb
D:\softwares\python2.7.18\python.exe gyp-win-tool link-with-manifests environment.x64 True qode.exe "D:\softwares\python2.7.18\python.exe gyp-win-tool link-wrapper environment.x64 False link.exe /nologo /OUT:qode.exe @qode.exe.rsp" 1 mt.exe rc.exe "qode.qode.exe.intermediate.manifest" qode.qode.exe.generated.manifest ..\..\..\src\qode.exe.manifest
  ζ­£εœ¨εˆ›ε»ΊεΊ“ qode.lib ε’Œε―Ήθ±‘ qode.exp
v8_base_without_compiler.lib(v8_base_without_compiler.isolate.obj) : error LNK2001: ζ— ζ³•θ§£ζžηš„ε€–ιƒ¨η¬¦ε· v8_Default_embedded_blob_
v8_base_without_compiler.lib(v8_base_without_compiler.isolate.obj) : error LNK2001: ζ— ζ³•θ§£ζžηš„ε€–ιƒ¨η¬¦ε· v8_Default_embedded_blob_size_
qode.exe : fatal error LNK1120: 2 δΈͺζ— ζ³•θ§£ζžηš„ε€–ιƒ¨ε‘½δ»€
Traceback (most recent call last):
  File "gyp-win-tool", line 386, in <module>
    sys.exit(main(sys.argv[1:]))
  File "gyp-win-tool", line 33, in main
    exit_code = executor.Dispatch(args)
  File "gyp-win-tool", line 76, in Dispatch
    return getattr(self, method)(*args[1:])
  File "gyp-win-tool", line 208, in ExecLinkWithManifests
    subprocess.check_call(ldcmd + add_to_ld)
  File "D:\softwares\python2.7.18\lib\subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'D:\softwares\python2.7.18\python.exe gyp-win-tool link-wrapper environment.x64 False link.exe /nologo /OUT:qode.exe @qode.exe.rsp qode.exe.manifest.res' returned non-zero exit status 1120
ninja: build stopped: subcommand failed.
node:child_process:903
    throw err;
    ^

Error: Command failed: ninja -j8 -C out/Release qode
    at checkExecSyncError (node:child_process:826:11)
    at Object.execSync (node:child_process:900:15)
    at execSync (D:\code\qode\build.js:14:35)
    at Object.<anonymous> (D:\code\qode\build.js:59:1)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:816:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
    at node:internal/main/run_main_module:17:47 {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 8276,
  stdout: null,
  stderr: null
}

build error raises when I'm building qode, it seems that v8_Default_embedded_blob_ and v8_Default_embedded_blob_size_ are missing. I'm using vs2017, can anybody give me some advice on this problem? I appreciate it very much!

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.