Closed CodingQueries2023 closed 1 year ago
The output of node -p "require('node-rfc').environment"
shows that SAP NWRFC SDK "lib" folder is apparently not on PATH. The loader can't therefore find and load SAP NWRFC libraries.
"nwrfcsdk_lib_on_path": false
It should be fixed by adding c:\nwrfcsdk\lib
to PATH, as described in installation#windows
Thank you for your reply. The PATH in the environment variable shows as - But the error still exists.
Can you do the following test and post the output
cd \nwrfcsdk\bin
rfcexec
After running the command I am getting a pop-up which says "The code execution cannot proceed because MSVCP120.dll was not found. reinstalling the program may fix this problem".
Microsoft C Runtime DLLs version 12.0 (Visual C++ 2013) is a prerequisite for SAP NWRFC SDK. Is it installed on your system?
No, I didn't have it on my system so I installed it. And now I am getting the following output-
it is correct output installation.md#verify-sap-nwrfc-sdk-installation
The node-rfc should work as well :)
Unfortunately I am still getting the same error.
I also created a fresh folder and did npm init -y and then installed node-rfc but still I am getting the error.
Can you run the Windows Process monitor, to check which library exactly fails to load?
Just start the Process Monitor and run the following command to reproduce. Similar issue discussed here: https://github.com/SAP/node-rfc/issues/115#issuecomment-570248671
node -p "require('c:\node-rfc\node_modules\node-rfc\lib\binding\sapnwrfc.node')"
I am getting something like this-
can you find sapnwrfc.dll
and any error in log? The status different from SUCCESS ?
I could not find the sapnwrfc.dll and apart from the SUCCESS there is only BUFFER OVERFLOW and NAME NOT FOUND.
No idea what could be the problem. Are you using standard Windows system ? Which version/edition?
I just tested as follows:
npm init -y
npm install node-rfc
node -p "require('node-rfc')"
Can you check if C:...\node_modules\node-rfc\lib\binding\sapnwrfc.node
exists ? What is the output of direct require of that file:
cd ... to sapnwrfc.node folder
node -p "require('./sapnwrfc.node')"
Fresh new install should work. Some users (years ago) reported that was the only solution for them after MC C++ DLLs installed after some other libraries.
I am using windows 10, Version 21H2.
I checked and yes the file sapnwrfc.node at C:...\node_modules\node-rfc\lib\binding\sapnwrfc.node exists.
Below is the output of the command node -p "require('./sapnwrfc.node')" ---
Something is apparently wrong with the installation:
1) nwrfcsdk_lib_on_path
in environment is shown as false
and should be true
2) The sapnwrfc.node file size in File Explorer is 276 KB and on test system is 224KB
Could you please create fresh new folder and post the full log
mkdir test
cd test
npm init -y
# show SAPNWRFC_HOME and PATH
echo $env:SAPNWRFC_HOME
echo $env:PATH
# or echo %PATH% ...
npm install node-rfc
node -p "require('node-rfc')"
Are you using some sort of "special" Windows installation, like running in virtual machine or similar hosted environment?
Could you please also check the file type of sapnwrfc.node, using TrID or similar Windows utility ?
Yes, I am running it on a virtual machine.
After this fresh installation -------
Thank you @CodingQueries2023. Could you please also post the full console output as per my last comment
mkdir test
cd test
npm init -y
npm install node-rfc
Also
Could you please also check the file type of sapnwrfc.node, using TrID or similar Windows utility ?
For some reason I couldn't run TrID, is there any other software that might help cause?
For some reason I couldn't run TrID, is there any other software that might help cause?
I can check, could you please attach your sapnwrfc.node
file here?
Also run npm install --production node-rfc --loglevel verbose
in fresh new test folder and attach the full installation log to message.
sapnwrfc.node
file from binding.zip is Linux executable and can't run on Windows. It causes the loading error: "sapnwrfc.node is not a valid Win32 application"
The executable file format can be determined also by prefix shown in plain text editor, like notepad.exe. The prefix of your sapnwrfc.node is ELF and for Windows it should be MZ.
Also the size of that Linux sapnwrfc.node differs from what is shipped in latest node-rfc release.
Your NPM is apparently configured for custom registry, getting corrupted installation package from there.
Thank you @bsrdjan for your reply.
I can't change the registry but is there a way to get around this and fix the issue?
only manual workaround. sapnwrfc.node executables for supported platforms are attached to node-rfc GitHub releases. You can
You can also use this sapnwrfc.node.zip for Windows, for node-rfc 2.7.1
It should work but there could be also issues in case the rest of the package from custom registry is older node-rfc version, possibly incompatible with the latest sapnwrfc.node executable.
Why not install from standard registry and avoid the risk ?
I followed the step 1 and I am getting the following output, I am not sure but I think it works, could you please confirm.
looks correct now
@CodingQueries2023, what type of virtual machine are you using and can you describe how your Windows system is hosted?
It could help other users with similar setup if we can find out why Linux binaries are fetched instead of Windows.
Hi @bsrdjan On server I am getting the error RFC_COMMUNICATION_FAILURE and it is automatically trying to connect to our IP with PORT 3300, which is a wrong port. My correct PORT is 3629 but instead of 3629 it is trying to connect to 3300 and is getting failed to connect to. In my docker file I have mentioned the PORT 3629 and not 3300. Is there anything that you can suggest about the issue?
Could you please create another issue for communication error?
You can also try node-rfc pre-release 3.0.0-rc.1. The packaging is changed and node-rfc contains binaries for all platforms, not fetching them from Github any more.
Sure I will create a new issue for communication error
Describe the bug I have 64 bit node js installed on my system and have installed 64 bit NWRFC SDK but I am still getting the error "\?\C:...\node_modules\node-rfc\lib\binding\sapnwrfc.node is not a valid Win32 application".
To Reproduce Describe how the
node-rfc
is installed, like locally or globally and usingnpm install
or build from source. I have installed node-rfc locally from https://www.npmjs.com/package/node-rfc , using the command "npm i node-rfc".Environment
node -p "require('node-rfc').environment"