node-rfc: Error - Unable to find module

Hello, need your help in resolving an error that I encountered after installing node-rfc. Environment: Windows 7 X64 Node version : 6.7.0 Installed SAPNWRFC at C:\NWRFC and also set up the PATH environment variable to point to C:\NWRFC\lib I was able to install node-rfc in my current working directory using the command npm install node-rfc. I checked if the installation went through successfully using the following commands. node var r = require('node-rfc') But it gives me the following error:

Error: The specified module could not be found. \?\C:\Users\Vinc\Documents\Matrix\node_modules\node-rfc\build\rfc\rfc.node at Error (native) at Object.Module._extensions…node (module.js:583:18) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Module.require (module.js:483:17) at require (internal/module.js:20:19) at Object.<anonymous> (C:\Users\Vinc\Documents\Matrix\node_modules\node -rfc\index.js:6:11) at Module._compile (module.js:556:32) at Object.Module._extensions…js (module.js:565:10)

The file

\?\C:\Users\Vinc\Documents\Matrix\node_modules\node-rfc\build\rfc\rfc.node

is present in the local directory where node-rfc was installed. I am not sure if the prefix \?\ refers to the global directory for npm packages. I tried to install node-rfc globally: npm install node-rfc -g -s but got an error that the node-module could not be found. Thanks for your time.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 20 (6 by maintainers)

Most upvoted comments

I had this issue and it seems to be related to amd computer chip. I switched to intel based and this went away.

@chonlanotr, according to https://nodejs.org/en/download/releases/ neither 6.9.1, nor 4.6.2 ABI version matches the 8.11.2 ABI version 57. You can build from source but the build should work automatically, during npm install node-rfc, if all prerequisites met. Would you mind to open new issue, describe your installation steps and post the failure log ?

@VinnyBuck The issue is pretty easily resolved and it is stunning how this is not obvious and fixed. node-rfc tries to find rfc.node in /build/rfc… but it’s not in there. There is another folder “win32_x64” that contains rfc.node. Just copy that to the parent /rfc and you’re all set.

This error has nothing to do with NWRFC at all. You should be able to run the server without the libs. The node module only looks for them when you actually try to use them.

yes, the *4568 is the right one and glad it works now.

Just as a troubleshooting note (will add later to README), in case of Error: %1 ist keine zulässige Win32-Anwendung (%1 is not a valid Win32 application), first check prerequisites:

  1. Verify that SAP NWRFC SDK is properly installed, by chdir to SAPNWRFC_HOME subfolder bin and running rfcexec. No error should reported, only the usage help.

  2. If the error in step 1 occurs, check SAP NWRFC SDK paths and check if Visual C++ Redistributable for Microsoft Visual Studio 2015 installed

  3. Check if the nodejs version (32 or 64 bit) matches the SAP NWRFC SDK version (32/64 bit). In case the nodejs version manager used, it may default to 32 bit, on a 64 bit platform with 64 bit NWRFC SDK installed.