Closed jimmymain closed 6 years ago
Does the error happen during or after installation, when running some test script for example?
Could you please post the nodejs version and how to reproduce the issue (steps before the error happens) ?
Please also check the npm version. The npm upgrade fixed the installation issue I had with node 6.x: https://npm.community/t/enotempty-directory-not-empty-rename-on-nodejs-6-only/513/2
Hello bsrdjan, could you please help?
I can confirm jimmymain's error. I installed node-rfc using npm without errors, but when I run the example code, I get exactly the same message:
node test.js
module.js:681
return process.dlopen(module, path._makeLong(filename));
^
Error: The specified module could not be found.
\\?\C:\Users\aortiz30\OneDrive - DXC Production\HPE\Xiba\msbot\xiba\node_modules\node-rfc\lib\binding\win32-x64-node-v57\sapnwrfc.node
at Object.Module._extensions..node (module.js:681:18)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\aortiz30\OneDrive - DXC Production\HPE\Xiba\msbot\xiba\node_modules\node-rfc\lib\wrapper\sapnwrfc-client.js:7:17)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Users\aortiz30\OneDrive - DXC Production\HPE\Xiba\msbot\xiba\node_modules\node-rfc\lib\index.js:6:10)
at Module._compile (module.js:652:30)
My versions are:
$ npm --versions
{ npm: '6.4.0',
ares: '1.10.1-DEV',
cldr: '32.0',
http_parser: '2.8.0',
icu: '60.1',
modules: '57',
napi: '3',
nghttp2: '1.32.0',
node: '8.11.3',
openssl: '1.0.2o',
tz: '2017c',
unicode: '10.0',
uv: '1.19.1',
v8: '6.2.414.54',
zlib: '1.2.11' }
My code:
"use strict";
var rfc = require('node-rfc');
var connParams = {
"user": "60095751",
"passwd": "not-my-real-password",
"ashost": "saplh3.sapnet.hp.com",
"sysnr": "10",
"client": "200",
"lang": "EN"
};
var client = new rfc.Client(connParams, true);
console.log('Client Version: ', client.getVersion());
console.log('Connecting...');
client.connect(function(err) {
if (err) {
return console.error('could not connect to server', err);
}
console.log('Invoking STFC_CONNECTION');
client.invoke('STFC_CONNECTION',
{ REQUTEXT: 'H€llö SAP!' },
function(err, res) {
if (err) {
return console.error('Error invoking STFC_CONNECTION:', err);
}
console.log('Result STFC_CONNECTION:', res);
});
var importStruct = {
RFCFLOAT: 1.23456789,
RFCCHAR1: 'A',
RFCCHAR2: 'BC',
RFCCHAR4: 'DEFG',
RFCINT1: 1,
RFCINT2: 2,
RFCINT4: 345,
RFCHEX3: 'fgh',
RFCTIME: '121120',
RFCDATE: '20140101',
RFCDATA1: '1DATA1',
RFCDATA2: 'DATA222'
};
var importTable = [importStruct];
console.log('Invoking STFC_STRUCTURE');
client.invoke('STFC_STRUCTURE',
{ IMPORTSTRUCT: importStruct, RFCTABLE: importTable },
function(err, res) {
if (err) {
return console.error('Error invoking STFC_STRUCTURE:', err);
}
console.log('Result STFC_STRUCTURE:', res);
});
});
Error in module loader (process.dlopen(module ...
) usually indicates that SAP NW RFC SDK libraries cannot be loaded. In most cases the DLL files (SO on Linux) are either nor installed or not on path where the loader looks for them.
On Windows, SAP NW RFD SDK DLLs must be on system or user PATH and they should be 64 bit libs if you use 64 bit system. Sometimes people download and unpack 32 bit SDK (SAP filenames here are cryptic). Did you check that?
In most cases the DLL files (SO on Linux) are either nor installed or not on path where the loader looks for them.
I just needed to restart my machine for the path variables to be reset. It is working now.
thanks!
Aaron Ortiz
Glad to hear it works. Will try to improve the error message when sap libs loading fails.
Please feel free to use the @next version, works quite stable and has more improvements.
Fixed in NAPI: 3502f4880d4b12992bb8e1570f9e85cb8b8ab870 482cc58fad15dbc4e65b8011d3b659576bc45726
I had this issue on an AMD image. I switched to an intel based image and the error went away.
The following error is displayed with a clean install:
The binary file, namely
C:\Projects\jco\node_modules\node-rfc\build\rfc\rfc.node
exists in the specified directory, so that's not the problem.