GithubHelp home page GithubHelp logo

Can't seem to build on windows about packer HOT 19 OPEN

nodegui avatar nodegui commented on September 13, 2024 6
Can't seem to build on windows

from packer.

Comments (19)

MvRens avatar MvRens commented on September 13, 2024 1

I had the same issue with a project I started from scratch which does not use webpack. nodegui-starter works fine for me too. Maybe I shouldn't be so stubborn and just use the starter as a base, but I like to understand all the components involved this way, sue me :-)

After a lot of comparing here's my conclusion. It's not really a proper solution as I suspect the file is platform-dependant after the npm install, but I thought I'd share it in case it helps anyone else:

Copy the file node_modules@nodegui\nodegui\build\Release\nodegui_core.node to whatever folder is passed to the packer. By default this is "dist", but since I had no compile step mine was "src". It's the path after "npx nodegui-packer --pack".

I noticed this file is copied to dist by webpack, and there is a native-addon-loader in the config, but I'm not proficient enough to figure out how it knows about that exact file.

from packer.

a7ul avatar a7ul commented on September 13, 2024 1

Hey @MvRens The native addon loader just copies all *.node files it encounters which is the standard extension for all nodejs native modules. They are basically renamed versions of .dll, .dylib files.

from packer.

a7ul avatar a7ul commented on September 13, 2024

Hi, Could you provide more logs ?
Also can I take a look at the project code somewhere ? @nguyennk

from packer.

nguyennk avatar nguyennk commented on September 13, 2024

here are the full log

C:\Users\Administrator\Desktop\Tools\KU-NitroListener>npx nodegui-packer --init KU-NitroListener

C:\Users\Administrator\Desktop\Tools\KU-NitroListener>npx nodegui-packer --pack ./dist
cleaning build directory at C:\Users\Administrator\Desktop\Tools\KU-NitroListener\deploy\win32\build
creating build directory at C:\Users\Administrator\Desktop\Tools\KU-NitroListener\deploy\win32\build
copying qode
copying dist
running windeployqt
stderr: Please specify the binary or folder.


stdout: Usage: C:\Users\Administrator\Desktop\Tools\KU-NitroListener\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.

(node:372) UnhandledPromiseRejectionWarning: child process exited with code 1
(node:372) 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:372) [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.

from packer.

nguyennk avatar nguyennk commented on September 13, 2024

dependencies

"dependencies": {
    "@nodegui/nodegui": "^0.18.2",
    "async": "^3.2.0",
    "axios": "^0.19.2",
    "bluebird": "^3.7.2",
    "debounce-promise": "^3.1.2",
    "discord.js": "^11.6.3",
    "fs": "^0.0.1-security",
    "hwid": "^0.1.1",
    "lodash": "^4.17.15",
    "moment": "^2.24.0",
    "qs": "^6.9.3"
  },
  "devDependencies": {
    "@babel/cli": "^7.8.4",
    "@babel/core": "^7.9.0",
    "@babel/preset-env": "^7.9.0",
    "@babel/preset-react": "^7.9.4",
    "@nodegui/packer": "^1.4.0",
    "@types/node": "^13.9.3",
    "eslint": "^6.8.0",
    "file-loader": "^5.1.0",
    "nodemon": "^2.0.2",
    "prettier": "^2.0.3",
    "rimraf": "^3.0.2"
  }

from packer.

a7ul avatar a7ul commented on September 13, 2024

Thanks i ll take a look and report back during this weekend (kindof swamped with work this week)

from packer.

nguyennk avatar nguyennk commented on September 13, 2024

Cool :)

from packer.

zombiestruck avatar zombiestruck commented on September 13, 2024

I'm encountering the same issue, any updates?

from packer.

jrebmann avatar jrebmann commented on September 13, 2024

I got the same problem in my project.
Did I forget any parameter or setting?
Interestingly the problem doesn't occur in my template 'nodegui-starter'.

I think there is a mistake in my project configuration ... but I have no idea which one.

=====
UPDATE:
I think I found the bug!
My main-file was named cli.ts so I changed the default index.js to cli.js in the webpack.config.js.
After that the builder hasn't worked anymore.
Maybe the name index.js is hard-coded in the source code?

from packer.

davehibshman avatar davehibshman commented on September 13, 2024

I am having the same issue. Has anyone managed to resolve this yet?

from packer.

costafrancesco94 avatar costafrancesco94 commented on September 13, 2024

I have same issue with vue-nodegui-starter: app compile and runs from npm run start, packer build all but app does not launch: nothing happen. Also launching from powershell/cmd has no result.

Only changing the emitted file from main.js to index.js made it work (partially: a linked image files is not linked thus not displayed, and I cannot be sure about a linked ps1 script (included with file-loader and working in npm run start).

from packer.

costafrancesco94 avatar costafrancesco94 commented on September 13, 2024

I solved my issue by changing a little bit the webpack.config.js. I can confirm you can build (and pack also) on win and linux with this config

package.json

{
  "name": "@asd/node-gui",
  "version": "1.0.0",
  "description": "",
  "main": "src/index.js",
  "scripts": {
    "build": "webpack -p",
    "start": "webpack -p && qode ./dist/index.js",
    "debug": "webpack -p && qode --inspect ./dist/index.js",
    "pack": "npx nodegui-packer --pack ./dist"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@nodegui/nodegui": "^0.28.0",
    "@nodegui/vue-nodegui": "^0.0.5",
    "@vue/compiler-sfc": "^3.0.4",
    "css-loader": "^5.0.1",
    "express": "^4.17.1",
    "file-loader": "^6.2.0",
    "hertzy": "^0.1.1",
    "mini-css-extract-plugin": "^1.3.3",
    "node-loader": "^0.6.0",
    "open": "^7.3.0",
    "url-loader": "^4.1.1",
    "vue": "^3.0.4",
    "vue-loader": "16.0.0-beta.7",
    "webpack": "^4.43.0",
    "webpack-cli": "^3.3.12"
  },
  "devDependencies": {
    "@nodegui/packer": "^1.4.1"
  }
}

webpack.config.js

const path = require('path');
const { VueLoaderPlugin } = require('vue-loader');
const { compilerOptions } = require('@nodegui/vue-nodegui/dist/vueLoader');

// const CopyPlugin  = require("copy-webpack-plugin");

module.exports = (env = {}) => ({
    mode: env.prod ? 'production' : 'development',
    devtool: 'inline-source-map',
    entry: './src',
    target: 'node',
    output: {
        path: path.resolve(__dirname, 'dist'),
        //publicPath: '/dist/',
        filename: "index.js"
    },
    // node: {
    //     __dirname: false,
    //     __filename: false
    // },
    resolve: {
        extensions: ['.ts', '.js', '.vue', '.json'],
        alias: {
            vue: path.resolve(__dirname, './node_modules/@nodegui/vue-nodegui/dist'),
        },
    },
    module: {
        rules: [
            {
                test: /\.vue$/,
                use: {
                    loader: 'vue-loader',
                    options: {
                        compilerOptions,
                    },
                },
            },
            {
                test: /\.node$/,
                use: [{ loader: 'node-loader' }, { loader: 'file-loader' }],
            },
            {
                test: /\.(png|jpe?g|gif|svg|bmp|ps1)$/i,
                use: [{
                    loader: 'file-loader',
                    options: {
                        publicPath: "dist"
                    }
                }],
            },
        ],
    },
    plugins: [
        new VueLoaderPlugin(),
        /*new CopyPlugin({
            patterns: [
                { from: "web/dist", to: "web" },
            ],
        }),*/
    ],
});

from packer.

asheroto avatar asheroto commented on September 13, 2024

This is still a problem as of 2021-10-21. I get all kinds of errors when running

create-react-app --template react-nodegui rn-starter

Such as...

[os] external "os" 42 bytes {main} [built]
[path] external "path" 42 bytes {main} [built]
[url] external "url" 42 bytes {main} [built]
[util] external "util" 42 bytes {main} [built]
    + 424 hidden modules

ERROR in ./node_modules/@nodegui/nodegui/dist/lib/utils/addon.js
Module not found: Error: Can't resolve '../../../build/Release/nodegui_core.node' in 'C:\Users\User\Downloads\rn-starter\node_modules\@nodegui\nodegui\dist\lib\utils'
 @ ./node_modules/@nodegui/nodegui/dist/lib/utils/addon.js 3:14-65
 @ ./node_modules/@nodegui/nodegui/dist/lib/QtGui/QApplication.js
 @ ./node_modules/@nodegui/nodegui/dist/index.js
 @ ./src/app.tsx
 @ ./src/index.tsx
 @ multi webpack/hot/poll?100 ./src/index.tsx
ERROR in C:/Users/User/Downloads/rn-starter/node_modules/@types/react-reconciler/node_modules/@types/react/index.d.ts(3086,19):
TS2320: Interface 'ElementClass' cannot simultaneously extend types 'Component<any, {}, any>' and 'Component<any, {}, any>'.
  Named property 'props' of types 'Component<any, {}, any>' and 'Component<any, {}, any>' are not identical.
ERROR in C:/Users/User/Downloads/rn-starter/node_modules/@types/react-reconciler/node_modules/@types/react/index.d.ts(3086,19):
TS2320: Interface 'ElementClass' cannot simultaneously extend types 'Component<any, {}, any>' and 'Component<any, {}, any>'.
  Named property 'refs' of types 'Component<any, {}, any>' and 'Component<any, {}, any>' are not identical.
ERROR in C:/Users/User/Downloads/rn-starter/node_modules/@types/react-reconciler/node_modules/@types/react/index.

That goes on for awhile....

from packer.

imagitama avatar imagitama commented on September 13, 2024

Is this still being looked into?

from packer.

onfire4g05 avatar onfire4g05 commented on September 13, 2024

It's looking for the .node file located at node_modules@nodegui\nodegui\build\Release\nodegui_core.node in build/dist for the plugins. The default webpack configuration copies it to the ./dist/ every build.

I'm using esbuild though and so I copy the file after the esbuild is complete and things work properly.

from packer.

lovelyJason avatar lovelyJason commented on September 13, 2024

我和你一样的错误,真是见鬼了,官方示例代码都build不动?

from packer.

lovelyJason avatar lovelyJason commented on September 13, 2024

It has been four years, have you solved it, and have the authorities solved it? Why is it still difficult to build

from packer.

asheroto avatar asheroto commented on September 13, 2024

Last build was 3 years ago. I'm gonna guess this project is abandoned.

from packer.

lovelyJason avatar lovelyJason commented on September 13, 2024

Last build was 3 years ago. I'm gonna guess this project is abandoned.

But how did the developer run away in the middle of the answer? Didn't he say that he was busy this week

from packer.

Related Issues (20)

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

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

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.