Hi,
I know I posted about getting a "Error: %1 is not a valid Win32 application" error on the installation I'm doing for node-java on Windows (Windows 10 64 bit, in this case) in an earlier post, but I am also getting that error in a different situation, so I wanted to separate the issues.
In this case, I have a really small test app, "really-small-test.js":
var java = require('java');
It's a "1 line" only.
If I am in the node directory, "E:\INSTALL-FILES\Node.js\EXPLODED\node-v6.10.0-win-x64\", and I run "node really-small-test.js", it runs without error.
But, if I change directory to a different directory "E:\apps\.....\gx_expressweb" and run "node really-small-test.js", I am getting:
module.js:597
return process.dlopen(module, path._makeLong(filename));
^
Error: %1 is not a valid Win32 application.
\\?\E:\apps\...\gx_expressweb\node_modules\java\build\Release\nodejavabridge_bindings.node
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (E:\apps\...\gx_expressweb\node_modules\java\lib\nodeJavaBridge.js:21:16)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
Why would running that small all, which is only doing "require('java')" work when I run it in the base node.JS directory, but blow up when I run the same app in a different directory?
I have checked that I have NODE_PATH set correctly in the environment and also node is on the PATH.
Thanks,
Jim