nw-builder icon indicating copy to clipboard operation
nw-builder copied to clipboard

`run` mode gives an error: FILE_ERROR_NOT_FOUND: No such file or directory

Open ackzell opened this issue 7 months ago • 3 comments

Has anybody seen this error before? I've searched the best I could but I don't seem to find the issue.

I don't have a repro, but I can upload the project I am presenting if need be.

  ~/experiments/nwjs                                                                                                                       󰋁 23.11.0 
➜ 
➜ nr dev

> [email protected] dev /Users/ackzell/experiments/nwjs
> nwbuild ./src/package.json



[ INFO ] Parse final options using node manifest
[ DEBUG ] Manifest: 
[ INFO ] Get version specific release info...
[ DEBUG ] Release info:
{
  "version": "v0.100.0",
  "date": "2025/05/23",
  "files": [
    "win-x64",
    "win-ia32",
    "linux-x64",
    "linux-ia32",
    "osx-x64",
    "osx-arm64"
  ],
  "flavors": [
    "normal",
    "sdk"
  ],
  "components": {
    "node": "23.11.0",
    "chromium": "137.0.7151.41"
  }
}

[ INFO ] Validate options.* ...
[ DEBUG ] Options:
{
  "mode": "run",
  "glob": false,
  "logLevel": "debug",
  "flavor": "normal",
  "version": "0.100.0",
  "verbose": true,
  "platform": "osx",
  "arch": "arm64",
  "downloadUrl": "https://dl.nwjs.io",
  "manifestUrl": "https://nwjs.io/versions",
  "cacheDir": "./cache",
  "cache": true,
  "ffmpeg": false,
  "shaSum": true,
  "argv": [],
  "srcDir": "."
}
[ INFO ] Getting NW.js and related binaries...
[ INFO ] Running NW.js in run mode...
[0526/220220.055910:ERROR:third_party/zlib/google/zip.cc:179] Cannot open '/Users/ackzell/experiments/nwjs/cache/nwjs-v0.100.0-osx-arm64/nwjs.app/Contents/Resources/app.nw': FILE_ERROR_NOT_FOUND: No such file or directory (2)

Image

As you can tell, if I click on the NW app on the dock, all I get is the alert box with the OK button and another error:

Failed to load extension from: /Users/ackzell/experiments/nwjs. Could not load background script 'index.js'.

Some (hopefully) relevant notes

  • Apple M1 Pro
  • MacOs Sequoia 15.0.1 (24A348)
  • I made sure I am running the version of node that matches the nw release
  • I've tried different versions of nw
  • I've tried both sdk and normal flavors
  • I've tried older versions of nw-builder (4.x) and all of them so far have given me the same issue
  • I restarted my computer after installing nw and nw-builder
  • Using the nw package I am getting the same error, but the app actually loads. I can get a screenshot of that too.

ackzell avatar May 26 '25 20:05 ackzell

Will look into this

ayushmanchhabra avatar Jun 06 '25 15:06 ayushmanchhabra

Not able to reproduce.. I am using a x64 MacOS. Will ask Brian to repro

ayushmanchhabra avatar Jun 15 '25 17:06 ayushmanchhabra

Thank you, I appreciate it!

ackzell avatar Jun 16 '25 13:06 ackzell

This bug report is lacking sufficient detail. Yes, the project should be uploaded if any help is expected.

  1. What are the two package.json files you shown in your screenshots? Why do you have one for "myapp" and one for "nwjs-test" shown? I suspect this is the cause of your issue (see below).
  2. The error shown in the NW.js popup is very clear. It says the background script index.js cannot be found. In your package.json for the "nwjs-test" app, you have set main to "index.js", which does not appear anywhere in your file/directory tree.
  3. The following error message is benign. I see it even when the app runs successfully:
     Cannot open '/Users/ackzell/experiments/nwjs/cache/nwjs-v0.100.0-osx-arm64/nwjs.app/Contents/Resources/app.nw':  FILE_ERROR_NOT_FOUND: No such file or directory (2)
    
  4. The following works perfectly fine for me with both Node.js 22.18.0 and 23.11.0:

/app/package.json

{
    "name": "test-app",
    "main": "index.html",
    "nwbuild": {
        "mode": "run",
        "glob": false,
        "logLevel": "debug",
        "flavor": "normal",
        "version": "0.100.0",
        "verbose": true
    },
    "devDependencies": {
        "nw-builder": "^4.14.2"
    }
}

/app/index.html

<html>
    <body>
        Hello world.
    </body>
</html>

Command to launch: npx nwbuild ./package.json

sysrage avatar Aug 11 '25 15:08 sysrage

Thank you for looking into this. I can confirm placing everything at the root level makes run mode work fine.

Sorry for not providing sufficient detail.

I don't quite remember why I wanted to do the nested package.json thing. Maybe I wanted to have separate manifests to have a workflow for running in dev mode and also be able to build the app using a different one. I've created a set up with https://github.com/evshiron/nwjs-builder-phoenix in the past and was experimenting with nw-builder.

I'm not using it right now anymore, but If I ever try to do this again and I remember what my objective was I'll try to ask again.

Cheers!

ackzell avatar Aug 11 '25 20:08 ackzell