SAP / node-rfc

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

On windows: Impossibile trovare il modulo specificato - The specified module could not be found #127

Closed sbarzaghialteaup closed 4 years ago

sbarzaghialteaup commented 4 years ago

Hi,

On windows when I try to load the node-rfc module with: const r = require ('node-rfc')

I get the message error: Impossibile trovare il modulo specificato In english should be "The specified module could not be found"

In the path the %SAPNWRFC_HOME%\lib is correct, launching the set command to check the path I get: Path=...;C:\nwrfcsdk\bin;C:\nwrfcsdk\lib;

(no problems using it on ubuntu)

Thank you for help Sam

bsrdjan commented 4 years ago

Hi Sam,

did you test if SAP NWRFC SDK is properly installed:

cd %SAPNWRFC_HOME%\bin
rfcexec.exe

and if the output is like in documentation ?

sbarzaghialteaup commented 4 years ago

Hi,

Yes tested, it's correctly installed, I can execute it: image

thanks for help Sam

sbarzaghialteaup commented 4 years ago

More info: C:\Users\sbarzaghi\Documents>mkdir test-node-rfc

C:\Users\sbarzaghi\Documents>cd test-node-rfc

C:\Users\sbarzaghi\Documents\test-node-rfc>ver Microsoft Windows [Versione 10.0.18362.693]

C:\Users\sbarzaghi\Documents\test-node-rfc>npm install node-rfc

node-rfc@1.0.5 preinstall C:\Users\sbarzaghi\Documents\node_modules\node-rfc npm install cmake-js prebuild-install prebuild node-addon-api

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm notice created a lockfile as package-lock.json. You should commit this file.

node-rfc@1.0.5 install C:\Users\sbarzaghi\Documents\node_modules\node-rfc prebuild-install --tag-prefix -r napi || npm run prebuild

npm WARN saveError ENOENT: no such file or directory, open 'C:\Users\sbarzaghi\Documents\package.json' npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN enoent ENOENT: no such file or directory, open 'C:\Users\sbarzaghi\Documents\package.json' npm WARN Documents No description npm WARN Documents No repository field. npm WARN Documents No README data npm WARN Documents No license field.

C:\Users\sbarzaghi\Documents\test-node-rfc>set | findstr SAPNW SAPNWRFC_HOME=C:\nwrfcsdk

C:\Users\sbarzaghi\Documents\test-node-rfc>set | findstr path Path=C:\ProgramData\DockerDesktop\version-bin;C:\Program Files\Docker\Docker\Resources\bin;C:\Python37\Scripts\;C:\Python37\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Infocert\DiKe 6\RAO;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\nwrfcsdk\lib;C:\nwrfcsdk\bin;C:\Users\sbarzaghi\AppData\Local\Microsoft\WindowsApps;C:\Users\sbarzaghi\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\sbarzaghi\AppData\Roaming\npm;C:\Users\sbarzaghi\AppData\Local\now-cli;C:\Users\sbarzaghi\AppData\Local\Programs\Microsoft VS Code Insiders\bin;C:\Users\sbarzaghi\AppData\Local\hyper\app-3.0.2\resources\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Users\sbarzaghi\AppData\Local\Programs\Fiddler;C:\nwrfcsdk\bin;C:\nwrfcsdk\lib;

C:\Users\sbarzaghi\Documents\test-node-rfc>rfcexec Error: Not all mandatory parameters specified Please start the program in the following way: rfcexec -t -a -g -x -f -s The options "-t" (trace), "-f" and "-s" are optional.

Below further optional parameters are listed. You can find their documentation in sapnwrfc.ini: -on_cce <0, 1, 2> (On Character Conversion Error) -cfit (Conversion Fault Indicator Token - the substitute symbol used if on_cce=2) -keepalive (Sets the keepalive option. Default is 0.) -delta <0, 1> (default 1, i.e. use delta-manager) -no_compression (table compression, default is 0, i.e. compression is on)

C:\Users\sbarzaghi\Documents\test-node-rfc>dir /s /w %SAPNWRFC_HOME% Il volume nell'unità C è OS

Directory di c:\nwrfcsdk

[.] [..] [bin] [demo] [doc] [include] [lib] 0 File 0 byte

Directory di c:\nwrfcsdk\bin

[.] [..] dev_rfc.log rfcexec.exe startrfc.exe 3 File 50.317 byte

Directory di c:\nwrfcsdk\demo

[.] [..] companyClient.c readme.txt rfcexec.cpp rfcexec.h sapnwrfc.ini sflightClient.c sso2sample.c startrfc.cpp startrfc.h stfcDeepTableServer.c ThroughputSample.c 11 File 126.438 byte

Directory di c:\nwrfcsdk\doc

[.] [..] licenses.txt release_notes.txt 2 File 33.465 byte

Directory di c:\nwrfcsdk\include

[.] [..] sapdecf.h sapnwrfc.h sapucrfc.h 3 File 523.887 byte

Directory di c:\nwrfcsdk\lib

[.] [..] icudt50.dll icuin50.dll icuuc50.dll libicudecnumber.dll libsapucum.dll libsapucum.lib sapnwrfc.dll sapnwrfc.lib sapnwrfc.pdb 9 File 48.934.614 byte Totale file elencati: 28 File 49.668.721 byte

C:\Users\sbarzaghi\Documents\test-node-rfc>node -v v11.6.0

C:\Users\sbarzaghi\Documents\test-node-rfc>node

const rfcClients = require("node-rfc"); Error: Impossibile trovare il modulo specificato. \?\C:\Users\sbarzaghi\Documents\node_modules\node-rfc\lib\binding\sapnwrfc.node

The SAP NW RFC SDK could not be loaded, check the installation: http://sap.github.io/node-rfc/install.html#sap-nw-rfc-sdk-installation at Object.Module._extensions..node (internal/modules/cjs/loader.js:750:18) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:560:12) at Function.Module._load (internal/modules/cjs/loader.js:552:3) at Module.require (internal/modules/cjs/loader.js:657:17) at require (internal/modules/cjs/helpers.js:22:18) at Object. (C:\Users\sbarzaghi\Documents\node_modules\node-rfc\lib\wrapper\sapnwrfc-client.js:6:15) at Module._compile (internal/modules/cjs/loader.js:721:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:560:12) at Function.Module._load (internal/modules/cjs/loader.js:552:3) at Module.require (internal/modules/cjs/loader.js:657:17) at require (internal/modules/cjs/helpers.js:22:18)

sbarzaghialteaup commented 4 years ago

Hi,

Solved copying the file vcruntime140_1.dll into C:\nwrfcsdk\lib image

bsrdjan commented 4 years ago

Yes, thet should be the DLL mentioned in prerequisites. Can you confirm that rfcexec.exe works without it?

sbarzaghialteaup commented 4 years ago

Hi,

The prerequisite at https://github.com/SAP/node-rfc and note 2573790 is: "Visual C++ Redistributable Packages for Visual Studio 2013"

I had already this package installed on my system.

Using process monitor I get this: image

Copied the missing file from another program folder (microsoft teams) and now it's fine.

Yes, rfcexec.exe works without it.

Thank you Sam

bsrdjan commented 4 years ago

On a fresh new Windows 10 system, with Visual C Redistributable 2013 installed, the file is present both in Windows\System and in VC Redistributable:

Screenshot 2020-03-17 at 13 38 38

I also tested and rfcexec.exe works without this file but node-rfc not, good to know.

The VC runtime re-installation should normally fix missing files, otherwise fresh new Windows installation. There are similar problems reported by users who previously uninstalled older VC runtimes or similar Microsoft SDKs, before installing the newer one.

sbarzaghialteaup commented 4 years ago

Hi,

I reinstalled the VC runtime 2013, repair options but no resolved.

Thank you for support Sam

bsrdjan commented 4 years ago

The repair and reinstallation do not always work on Windows. Users spend hours and days sometimes trying to make it work that way and finish with Windows re-installation. You may try with Windows trial fresh new install first.