Closed Zefau closed 2 years ago
Could you please describe steps how to install/run NodeJS in "standalone mode" on Windows?
node.exe
from https://nodejs.org/dist/v14.18.1/win-x64/ (in my case x64)node.exe
and the script above in the same folder node.exe
to cli.exe
or anything)node.exe script.js
cli.exe script.js
) [ Note that .exe
is important; otherwise the global installed Node.js will be used ]The nodejs installation from binary archive is described only for Linux and it should work the similar way on Windows:
https://github.com/nodejs/help/wiki/Installation
The complete Windows binary archive should be downloaded and that bin
folder must be first (or prioritized) on PATH, like described in above mentioned documentation.
Could you please try if it works with the recommended installation?
Unbelievable - thank you very much for your help.
There is no bin
folder in the windows binaries and it works only with the node.exe
. But apparently it is slightly different in the binaries than the one I downloaded before?! The one in the binary works now as expected. And renaming the exe-file like I wrote above does not work - needs to be named node.exe
.
That is interesting, perhaps this is indeed the issue happening in #144?
Seems like it, but I don't know how to solve this with respect to Electron. I was also trying to get node-rfc running with Electron, but I failed, which is why I ended up using this "standone mode" of Node.js as a fallback.
I was also trying pkg
(https://www.npmjs.com/package/pkg), which apparentely uses an own compiled version of Node.js in some way. With pkg
it also fails - same as Electron.
Describe the bug
Connecting via node-rfc with an installed version of Node.js works perfectly fine (via command-line
node script.js
).Using the standalone exe file from Node.js (meanig
node.exe
from the binaries available at https://nodejs.org/en/download/) the errorError: A dynamic link library (DLL) initialization routine failed.
is thrown.To Reproduce
Running the following script (saved in
script.js
) vianode script.js
on the command line works perfectly. The result outputs the result of the remote function.Running the same script via downloaded exe-file using
node.exe script.js
(when being the same folder) results in the error mentioned above.The path(s) to the
nwrfcsdk
is valid in both cases (viaPATH
variable, which is set in the beginning of the script). Furthermore, thesapnwrfc.node
is also found on the paths provided (in case it is not found a different error is thrown).The same setup works e.g. for
better-sqlite3
(https://www.npmjs.com/package/better-sqlite3), which also compiled to a.node
file. Though, an additional path to a sdk is not required.Screenshots
None.
Environment
Installed Node.js outputs:
Standalone Node.js outputs:
Additional context
I think solving this might also be solving https://github.com/SAP/node-rfc/issues/144.