Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The specified module could not be found #210

Closed
vyking60 opened this issue Apr 15, 2021 · 8 comments
Closed

The specified module could not be found #210

vyking60 opened this issue Apr 15, 2021 · 8 comments
Assignees
Labels

Comments

@vyking60
Copy link

vyking60 commented Apr 15, 2021

I have installed SAP RFC SDK 750 on win X64. All post installation checks are OK, till loading node-rfc modules.
Copying nwrfcsdk\lib files (dll,...) to widows\system32 also didn't help

Environment looks OK:
C:\Users\si4uoh>@echo off
findstr Patch "%SAPNWRFC_HOME%\lib\sapnwrfc.dll"
750 Patch Level 7

Also PATH is OK

STARTRFC returns OK response form target SAP system (SAP system ID , netweaver version,...)

BUT node -p "require('node-rfc')" returns:

PS C:\_Data\_DEVELOPMENT\Node\saprfc> node -p "require('node-rfc')"
C:\_Data\_DEVELOPMENT\Node\saprfc\node_modules\node-rfc\lib\wrapper\noderfc-bindings.js:45
    throw ex;
    ^

Error: The specified module could not be found.
\\?\C:\_Data\_DEVELOPMENT\Node\saprfc\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.15063"
  },
  "env": {
    "SAPNWRFC_HOME": "C:\\Program Files\\SAP RFC SDK 750\\nwrfcsdk",
    "RFC_INI": "",
    "nwrfcsdk_lib_on_path": true
  },
  "versions": {
    "node": "14.16.1",
    "v8": "8.4.371.19-node.18",

How I can find where the problem is?

@bsrdjan
Copy link
Contributor

bsrdjan commented Apr 15, 2021

Is it maybe running on Microsoft IIS: #139 ?

Did you check if Visual C++ 2013 re-distributable installed: https://github.com/SAP/node-rfc#windows ?

How is node-rfc installed? Locally/globally, using npm install or built from source?

@bsrdjan
Copy link
Contributor

bsrdjan commented Apr 15, 2021

If nothing of above helps, the procmon can help find the missing part: #127 (comment)

@vyking60
Copy link
Author

Thanks for quick response!
IIS is not used. I am working directly in VSCode
C++ 2013 is installed - even both x386 and X64
node-rfc is installed with npm locally.
During debugging I see that exception is catched in noderfc-bindings.js on line 36:

exports.noderfc_binding = noderfc_binding = require("../binding/sapnwrfc");

And I see file sapnwrfc.node in bindings folder.

How can I get help procman?

@bsrdjan
Copy link
Contributor

bsrdjan commented Apr 15, 2021

procman can trace the DLLs loading chain, to find out which DLL exactly fails. Example: #127 (comment)

The VSCode itself does not matter but the re-distributable is important (Add/Remove Programs screenshot):

Screenshot 2021-04-15 at 14 32 49

If x86 not needed, best remove it and/or try to re-install the re-distributable.

You can trace runtime info before exception, adding something like this in node_modules/node-rfc/lib/wrapper/noderfc-bindings.js

// verify SAP NWRFC SDK is on PATH
console.log(process.env.PATH)
try {
    exports.noderfc_binding = noderfc_binding = require("../binding/sapnwrfc");
}

Could you please post the output of:

dir %SAPNWRFC_HOME%\lib

@vyking60
Copy link
Author

Visual C+ x386 is uninstalled;
Visual C++ 2013 X64 is still installed

Console.log of PATH and SAPNWRFC_HOME before exports.noderfc...:
image

dir %SAPNWRFC_HOME%\lib from TERMINAL node app folder: Variable not evaluated!!
image

dir ​from Command prompt;
image

@bsrdjan bsrdjan self-assigned this Apr 15, 2021
@bsrdjan
Copy link
Contributor

bsrdjan commented Apr 15, 2021

dir %SAPNWRFC_HOME%\lib from TERMINAL node app folder: Variable not evaluated!!

The PowerShell syntax is dir $env:SAPNWRFC_HOME\lib, should be fine

The NWRFC SDK looks like correct 64 bit version, no idea what else to check. RFC SDK files look correct and should work with the "lib" folder on PATH.

Perhaps to try with another Windows user or fresh new Windows installation. C++ redistributable re-installations do not always work as expected. Some users reported in Issues that only re-installation helped.

Or trace with procmon first.

@vyking60
Copy link
Author

Reinstallation would be the last option.
I played with procmon and created one file.
Can you check it if there is anything to see. Otherwise I would need some help to produce usefull one
Logfile.zip

@vyking60
Copy link
Author

Problem solved. Thanks for help, Srdjan.
(Re)Installation of C++ Build tools helped (MSVC 14.28)

@bsrdjan bsrdjan closed this as completed Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants