nwutils / nw-builder

Build NW.js applications for Linux, MacOS and Windows

Home Page:http://nwutils.io/nw-builder/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

nw-builder download stuck

qq253498229 opened this issue · comments

Issue Type

  • Bug Report
  • Feature Request
  • Other

Current/Missing Behaviour

nwbuild({
  srcDir: "./temp",
  mode: "build", // "run" | "build"
  version: "0.82.0",
  flavor: "normal", // "normal" | "sdk"
  platform: "osx", // "linux" | "osx" | "win"
  arch: "x64", // "ia32" | "x64" | "arm64"
  outDir: "./out/osx64",
  cacheDir: "./cache",
  cache:true,
  downloadUrl: 'https://npm.taobao.org/mirrors/nwjs',
  // downloadUrl: 'https://npmmirror.com/mirrors/nwjs',
  glob: false,
  logLevel: "debug",
})

When executing nwbuild and downloading files, the progress is not displayed at all. I noticed a warning:

(node:43016) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 close listeners added to [TLSSocket]. Use emitter.MAXLISTENERS() to increase the limit (Use node --trace-warnings ... to show where the warning was created)

I have added breakpoints in the code, but I found that none of them worked

image

Expected/Proposed Behaviour

download normally

Additional Info

WS-233.11799.229, JRE 17.0.9+7-b1087.7x64 JetBrains s.r.o., OS Mac OS X(x86_64) v13.6.1, screens 3840.0x2400.0; Retina

  • Package version: 4.4.2
  • Operating System: OS Mac OS X(x86_64) v13.6.1
  • Node version: v18.19.0/v20.10.0
  • NW.js version: none
  • Repro link:
  • ...

I tried removing the downloadUrl and using the official url, and the download worked fine. I suspect that this getRequest did not handle the 301 redirect issue

I removed the downloadUrl and changed to download the zip package through the official url.

But now there is another problem. Here is the log:

[ DEBUG ] System Platform: darwin
[ DEBUG ] System Architecture: x64
[ DEBUG ] Node Version: v20.9.0
[ DEBUG ] Build NW.js Version: 0.82.0
[ DEBUG ] Build Flavor: normal
[ DEBUG ] Build Platform: osx
[ DEBUG ] Build Architecture: x64
[ DEBUG ] Start getting binaries
[ DEBUG ] No existing binaries
[ DEBUG ] Downloading binaries
[ DEBUG ] Response from https://dl.nwjs.io/v0.82.0/nwjs-v0.82.0-osx-x64.zip
[ DEBUG ] Response from https://dl.nwjs.io/v0.82.0/nwjs-v0.82.0-osx-x64.zip
 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 99% | ETA: 1s | 135359659/136336747[ DEBUG ] Binary fully downloaded
 ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■ 100% | ETA: 0s | 136336747/136336747
[ DEBUG ] unzip -o "/Users/wangbin/src/own/wang-devops/wang-devops/nwjs/cache/nw.zip" -d "./cache"
Archive:  /Users/wangbin/src/own/wang-devops/wang-devops/nwjs/cache/nw.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of /Users/wangbin/src/own/wang-devops/wang-devops/nwjs/cache/nw.zip or
        /Users/wangbin/src/own/wang-devops/wang-devops/nwjs/cache/nw.zip.zip, and cannot find /Users/wangbin/src/own/wang-devops/wang-devops/nwjs/cache/nw.zip.ZIP, period.
[ DEBUG ] Command failed with status 9

It seems that at the moment of decompression, the zip package failed to parse.

Does it fail on v4.5.0?

Does it fail on v4.5.0?

Yes, I tried 4.5.0 and 4.4.2-beta.4]

Sorry, this doesn't seem to be related to NW.js.
It seems to be an issue with my WebStorm environment.

I tried running it using the system's terminal, and everything works fine.
But when I run the js file directly in WebStorm or use the built-in terminal, errors happened again.