`run` mode gives an error: FILE_ERROR_NOT_FOUND: No such file or directory
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)
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
sdkandnormalflavors - 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
nwandnw-builder - Using the
nwpackage I am getting the same error, but the app actually loads. I can get a screenshot of that too.
Will look into this
Not able to reproduce.. I am using a x64 MacOS. Will ask Brian to repro
Thank you, I appreciate it!
This bug report is lacking sufficient detail. Yes, the project should be uploaded if any help is expected.
- What are the two
package.jsonfiles 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). - The error shown in the NW.js popup is very clear. It says the background script index.js cannot be found. In your
package.jsonfor the "nwjs-test" app, you have setmainto "index.js", which does not appear anywhere in your file/directory tree. - 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) - 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
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!