SAP / node-rfc

Asynchronous, non-blocking SAP NW RFC SDK bindings for Node.js
Apache License 2.0
251 stars 73 forks source link

Error: The specified module could not be found. "sapnwrfc.node". Need help. First time use. #207

Closed sas10x closed 3 years ago

sas10x commented 3 years ago

My OS is Windows 10 Problem: PS C:\Users\krristannn\Music\INVENTORY SYSTEM\dev\bapi> node -p "require('node-rfc')" C:\Users\krristannn\Music\INVENTORY SYSTEM\dev\bapi\node_modules\node-rfc\lib\wrapper\noderfc-bindings.js:45 throw ex; ^

Error: The specified module could not be found. \?\C:\Users\krristannn\Music\INVENTORY SYSTEM\dev\bapi\node_modules\node-rfc\lib\binding\sapnwrfc.node

The SAP NW RFC SDK could not be loaded, check the installation: https://github.com/SAP/node-rfc/blob/master/doc/installation.md#sap-nwrfc-sdk-installation environment: { "platform": { "name": "win32", "arch": "x64", "release": "10.0.18363" }, "env": { "SAPNWRFC_HOME": "", "RFC_INI": "", "nwrfcsdk_lib_on_path": false }, "versions": { "node": "14.16.0", "v8": "8.4.371.19-node.18", "uv": "1.40.0", "zlib": "1.2.11", "brotli": "1.0.9", "ares": "1.16.1", "modules": "83", "nghttp2": "1.41.0", "napi": "7", "llhttp": "2.1.3", "openssl": "1.1.1j", "cldr": "37.0", "icu": "67.1", "tz": "2020a", "unicode": "13.0" } }

at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\Users\krristannn\Music\INVENTORY SYSTEM\dev\bapi\node_modules\node-rfc\lib\wrapper\noderfc-bindings.js:36:49)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\Users\krristannn\Music\INVENTORY SYSTEM\dev\bapi\node_modules\node-rfc\lib\index.js:14:14)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)

Followed all the directions.

  1. %SAPNWRFC_HOME% leads to C:\nwrfcsdk.
  2. rfcexec.exe works well.
bsrdjan commented 3 years ago

According to output above, the SAPNWRFC_HOME env variable is not set:

"env": {
"SAPNWRFC_HOME": "",
"RFC_INI": "",
"nwrfcsdk_lib_on_path": false
},

Not a must for run-time, just an observation.

Possible reasons could be:

The test is running with another user, possibly without access rights to C:\nwrfcsdk\lib folder ?

C:\nwrfcsdk\lib not on PATH ?

Which SAP NWRFC SDK version is installed, could you please verify release and post the output: https://github.com/SAP/node-rfc/blob/main/doc/installation.md#verify-sap-nwrfc-sdk-release

sas10x commented 3 years ago

Thank you so much sir. I just uninstalled the redistributable that comes along with the SAP Logon. Now it works. Thanks.