Code Monkey home page Code Monkey logo

Comments (23)

evshiron avatar evshiron commented on July 17, 2024 2

@vzamanillo Thanks a lot for the help!

from nwjs-builder.

evshiron avatar evshiron commented on July 17, 2024 1

@vzamanillo You are welcome. Using an earlier version of nw.js like 0.14.4 might help. I don't know.

from nwjs-builder.

evshiron avatar evshiron commented on July 17, 2024

Not good. It doesn't work in node.js 0.10/0.11, either. Maybe I should seek for another approach?

from nwjs-builder.

evshiron avatar evshiron commented on July 17, 2024

The tests passed and the built executables worked with node.js 0.10.44/0.11.16/4.0.0 on Windows. And when I went to test again on Mac OS X, the built executables also worked on Windows. WTF?

from nwjs-builder.

vzamanillo avatar vzamanillo commented on July 17, 2024

I don't know if it's related, but I am experiencing the same issue:

OS: Windows 10 x64
Node version: v4.4.6

Work's on Linux 64 without problems.

Build folder contents and package contents screenshot:

info

from nwjs-builder.

evshiron avatar evshiron commented on July 17, 2024

@vzamanillo I don't think this is related as this issue should produce an executable which fails opening with 7zip, but according to your screenshot, it worked as expected.
May I make sure what does "works on Linux 64 without problems" mean? "I run nwjs-builder on Linux and the Windows build works", or "I run nwjs-builder on Windows and the Linux build works"?
BTW what's your npm version? Did you try --production flag?

from nwjs-builder.

vzamanillo avatar vzamanillo commented on July 17, 2024

The linux build works (the package is created and app starts normally via ./app), in windows the build package is created but when execute it opens the following window

sin titulo

npm version: 2.15.8

The gulp task:

var gulp = require('gulp'),
    glp = require('gulp-load-plugins')(),
    nwb = require('nwjs-builder'),
    argv = require('yargs').alias('p', 'platforms').argv,
    paths = {
        base: './',
        build: './build',
        src: './src',
        css: './src/css',
        images: './src/images',
        language: './src/language',
        lib: './src/lib',
        templates: './src/templates',
        themes: './src/themes',
        vendor: './src/vendor'
    },
    detectCurrentPlatform = function () {
        switch (process.platform) {
        case 'darwin':
            return process.arch === 'x64' ? 'osx64' : 'osx32';
        case 'win32':
            return (process.arch === 'x64' || process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432')) ? 'win64' : 'win32';
        case 'linux':
            return process.arch === 'x64' ? 'linux64' : 'linux32';
        }
    };

// cleans build directory
gulp.task('clean:build', function () {
    return gulp.src(paths.build, {
        read: false
    }).pipe(glp.clean());
});

gulp.task('build', ['clean:build'], function () {
    return new Promise(function (resolve, reject) {
        nwb.commands.nwbuild(paths.src, {
            version: '0.15.4',
            platforms: argv.p ? argv.p : detectCurrentPlatform(),
            withFFmpeg: true,
            production: true,
            macIcns: paths.images + '/popcorntime.icns',
            winIco: paths.images + '/popcorntime.ico',
            sideBySide: false,
            //outputFormat: 'ZIP',
            outputDir: paths.build
        }, function (err) {
            if (err) {
                reject(err);
            }
            return resolve();
        });
    });
});

from nwjs-builder.

evshiron avatar evshiron commented on July 17, 2024

@vzamanillo What about unzipping devapp.exe to a directory and nw.exe <THAT_DIR> to see if it works? You can make use of decompressed nw.js prebuilts in $HOME/.nwjs-builder/.

from nwjs-builder.

vzamanillo avatar vzamanillo commented on July 17, 2024

Unzipping devapp.exe and executing from $HOME/.nwjs-builder/caches/binary-nwjs-v0.15.4-win-x64 works, the application runs as expected, in fact, with sideBySide: true works too... Do I missed something?

from nwjs-builder.

evshiron avatar evshiron commented on July 17, 2024

@vzamanillo Hmmm. It's weird. Have you tried other versions of nw.js?

from nwjs-builder.

vzamanillo avatar vzamanillo commented on July 17, 2024

NW.js 0.16.0-beta2: app does not run.
NW.js v0.15.4: app does not run.
NW.js v0.14.6: app does not run.

:/

from nwjs-builder.

evshiron avatar evshiron commented on July 17, 2024

:/

from nwjs-builder.

evshiron avatar evshiron commented on July 17, 2024

@vzamanillo I didn't find many differences between the building procedures for Linux and Windows. The last straw is to unzip the devapp.exe to a directory, pack contents of that directory as a .zip file, combine it with the executable with copy /b and see if it still works. If it works, then it should be an issue with util.ZipDirectory or util.CombineExecutable (but Linux builds use nearly the same steps as Windows').
BTW the sideBySide: false option will create a temporary .zip, which will be combined to the executable later. If you are interested in inspecting it, or try combining it on your own, the following modifications should do the tricks (you should be able to identify them in the compiled files by comparing the contexts):

If all of the above refuse to work, you can always send me a sample which I can play with and I will see what I can do for you. Good luck to you.

from nwjs-builder.

vzamanillo avatar vzamanillo commented on July 17, 2024

@evshiron , thank you very much for your help, I tried zipping the contents of my src folder to a package.nw file, and then do the combined executable with copy /b nw.exe+package.nw app.exe, same results, the application does not start and shows the default NW.js window... I will keep testing to find the problem.

from nwjs-builder.

vzamanillo avatar vzamanillo commented on July 17, 2024

Finally I got the way to do it work but I still without know what the problem was, I think is related to long paths in node_modules on Windows but I am not really sure because I find no way to debug NW.js when application runs, I tried with Sawbuck with no luck and I tried building the application with the SDK flavor and "chromium-args": "--enable-logging --v=1", in the app manifest with no luck too (the log does not contains concrete information).

The steps to build the package and do it work:

  • Uninstall node.js v4.4.7 LTS (npm 2.x)
  • Delete %appdata%/npm and %appdata%/npm-cache
  • Delete node_modules in the main src application directory (I got multiple errors about removing the directory due to long paths)
  • Install node.js v6.3.0 (npm 3.x)
  • Install gulp, deps... etc and run the build tasks again

from nwjs-builder.

evshiron avatar evshiron commented on July 17, 2024

@vzamanillo LOL that's why I asked about npm version first (but I thought you were using npm 3 when you said your node.js version was 4.4.6 and missed that "npm version: 2.15.8"). npm 3 uses a flat node_modules structure rather than the recursive structure from npm 2, in order to solve this long path issue.
I guess it's because nw.js unzips the combined .zip into %TEMP%, combined with %TEMP% some of the files get an absolute path longer than 256 characters, failing the unzipping process and thus nw.js opens with a default window.

from nwjs-builder.

vzamanillo avatar vzamanillo commented on July 17, 2024

I see, seems like it's a pretty old (and known) problem when building packages in Windows OS, I did find a lot of information about (too late :/), but I am glad because I learned much things about how NW.js works (LOL), in the other hand, I would like to help you with the original issue, I will try it.

Thank you one more time.

from nwjs-builder.

evshiron avatar evshiron commented on July 17, 2024

@vzamanillo That's really helpful. I use nvm-windows to switch node.js versions on Windows, which should bring convenience when you do the tests.
To test it, read CONTRIBUTING for the preparing steps. After npm test, the Windows build will be produced in temp/build/nwb-test-win-ia32/. Launch NWBTest.exe and see if it exits immediately.
If it doesn't and a default window shows up, see if it can be unzipped using 7zip. If not, then it's the issue.
The node.js versions to be tested are: 0.10, 0.11, 4.0, 4.1, 5.0 and 6.0 (LOL).

from nwjs-builder.

vzamanillo avatar vzamanillo commented on July 17, 2024

Build results (Windows 10, 64 bits):

  • node 4.0: 👍 (nw.js exits with code 233 & manually tested)
  • node 4.1: 👍 (nw.js exits with code 233 & manually tested)
  • node 5.0: 👍 (nw.js exits with code 233 & manually tested)
  • node 6.0: 👍 (nw.js exits with code 233 & manually tested)
  • node 6.3: 👍 (nw.js exits with code 233 & manually tested)

I can not test 0.10 and 0.11 because not compatible module version found for debug, decompress-zip, etc...

from nwjs-builder.

evshiron avatar evshiron commented on July 17, 2024

@vzamanillo The "nw.js exits with code 233" is for testing nwb nwbuild -r only. You will have to launch that NWBTest.exe manually after each build.
node.js 0.10 and 0.11 shouldn't have problems according to https://ci.appveyor.com/project/evshiron/nwjs-builder/ (the builds failed because it can't clean up temporary files, but if you read the logs, you will find the dependencies were installed successfully).

from nwjs-builder.

vzamanillo avatar vzamanillo commented on July 17, 2024

Can't run test with node 0.10 and node 0.11

npm ERR! Error: No compatible version found: debug@'^2.2.0'
npm ERR! Valid install targets:
npm ERR! ["0.0.1","0.1.0","0.2.0","0.3.0","0.4.0","0.4.1","0.5.0","0.6.0","0.7.0","0.7.1","0.7.2","0.7.3","0.7.4","0.8.0","0.8.1","1.0.0","1.0.1","1.0.2","1.0.3","1.0.4","2.0.0","2.1.0","2.1.1","2.1.2","2.1.3","2.2.0"]
npm ERR!     at installTargetsError (C:\Users\vzamanillo\AppData\Roaming\nvm\v0.10.0\node_modules\npm\lib\cache.js:682:10)
npm ERR!     at C:\Users\vzamanillo\AppData\Roaming\nvm\v0.10.0\node_modules\npm\lib\cache.js:597:10
npm ERR!     at saved (C:\Users\vzamanillo\AppData\Roaming\nvm\v0.10.0\node_modules\npm\node_modules\npm-registry-client\lib\get.js:138:7)
npm ERR!     at Object.oncomplete (fs.js:93:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! cwd C:\desarrollo\GitWorkspace\nwjs-builder
npm ERR! node -v v0.10.0
npm ERR! npm -v 1.2.14

If I ignore it and try to run the tests

C:\desarrollo\GitWorkspace\nwjs-builder>npm test

> [email protected] pretest C:\desarrollo\GitWorkspace\nwjs-builder
> npm run build


> [email protected] build C:\desarrollo\GitWorkspace\nwjs-builder
> babel -d . ./src/

"babel" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
npm ERR! [email protected] build: `babel -d . ./src/`
npm ERR! `cmd "/c" "babel -d . ./src/"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is most likely a problem with the nwjs-builder package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel -d . ./src/
npm ERR! You can get their info via:
npm ERR!     npm owner ls nwjs-builder
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.2.9200
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! cwd C:\desarrollo\GitWorkspace\nwjs-builder
npm ERR! node -v v0.10.0
npm ERR! npm -v 1.2.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\desarrollo\GitWorkspace\nwjs-builder\npm-debug.log
npm ERR! not ok code 0
npm ERR! Test failed.  See above for more details.
npm ERR! not ok code 0

from nwjs-builder.

evshiron avatar evshiron commented on July 17, 2024

@vzamanillo Oh, I have encountered this issue before, because of npm 1. Try using latest version of node.js like 0.10.44 and 0.11.16.

from nwjs-builder.

vzamanillo avatar vzamanillo commented on July 17, 2024

Build results (Windows 10, 64 bits):

  • node 0.10.44: 👍 (nw.js exits with code 233 & manually tested)
  • node 0.11.16: 👍 (nw.js exits with code 233 & manually tested)
  • node 4.0: 👍 (nw.js exits with code 233 & manually tested)
  • node 4.1: 👍 (nw.js exits with code 233 & manually tested)
  • node 5.0: 👍 (nw.js exits with code 233 & manually tested)
  • node 6.0: 👍 (nw.js exits with code 233 & manually tested)
  • node 6.3: 👍 (nw.js exits with code 233 & manually tested)

from nwjs-builder.

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.