A different "Error: %1 is not a valid Win32 application"

165 views
Skip to first unread message

O haya

unread,
Mar 17, 2017, 9:51:47 AM3/17/17
to node-java
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

O haya

unread,
Mar 19, 2017, 5:25:44 PM3/19/17
to node-java
Hi,

For the record, I found what was causing this problem.  It turned out that had another node_modules directory under that "gx_expressweb" directory.  Actually, I'm not sure how that directory got there, but anyway I deleted *that* node_modules dir and then "node really-small-test.js" also ran ok!

Jim
Reply all
Reply to author
Forward
0 new messages