jdorner / node-sapnwrfc

SAP Netweaver RFC SDK bindings for Node.js
MIT License
55 stars 23 forks source link

Could not load the bindings file #11

Open pravinraj opened 9 years ago

pravinraj commented 9 years ago

Hi, I have tried installing sapnwrfc in my linux 64 bit machine. But I am not able to install it. I have got the SAP SDK file of version 7.20 and also I copied the files from "lib" folder to /usr/lib and "include" folder to /usr/include. Then I tried to install module using "npm install sapnwrfc". But I got the below given error. Please help me to fix this issue:

npm http GET https://registry.npmjs.org/sapnwrfc npm http 304 https://registry.npmjs.org/sapnwrfc npm http GET https://registry.npmjs.org/bindings/0.3.0 npm http 304 https://registry.npmjs.org/bindings/0.3.0

sapnwrfc@0.1.5 install /usr/node_modules/sapnwrfc node preinstall.js

{ [Error: Could not load the bindings file. Tried: -> /usr/node_modules/sapnwrfc/build/Debug/sapnwrfc.node -> /usr/node_modules/sapnwrfc/build/Release/sapnwrfc.node -> /usr/node_modules/sapnwrfc/out/Debug/sapnwrfc.node -> /usr/node_modules/sapnwrfc/Debug/sapnwrfc.node -> /usr/node_modules/sapnwrfc/out/Release/sapnwrfc.node -> /usr/node_modules/sapnwrfc/Release/sapnwrfc.node -> /usr/node_modules/sapnwrfc/build/default/sapnwrfc.node -> /usr/node_modules/sapnwrfc/compiled/0.10/linux/x64/sapnwrfc.node] tries: [ '/usr/node_modules/sapnwrfc/build/Debug/sapnwrfc.node', '/usr/node_modules/sapnwrfc/build/Release/sapnwrfc.node', '/usr/node_modules/sapnwrfc/out/Debug/sapnwrfc.node', '/usr/node_modules/sapnwrfc/Debug/sapnwrfc.node', '/usr/node_modules/sapnwrfc/out/Release/sapnwrfc.node', '/usr/node_modules/sapnwrfc/Release/sapnwrfc.node', '/usr/node_modules/sapnwrfc/build/default/sapnwrfc.node', '/usr/node_modules/sapnwrfc/compiled/0.10/linux/x64/sapnwrfc.node' ] } error a precompiled module could not be found or loaded info trying to compile it... make: Entering directory /usr/node_modules/sapnwrfc/build' CXX(target) Release/obj.target/sapnwrfc/src/binding.o CXX(target) Release/obj.target/sapnwrfc/src/Connection.o CXX(target) Release/obj.target/sapnwrfc/src/Function.o ../src/Function.cc: In member function âv8::Handle<v8::Value> Function::NumToExternal(CHND, const SAP_UC*, v8::Handle<v8::Value>, unsigned int)â: ../src/Function.cc:538:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (valueU16.length() > len) { ^ ../src/Function.cc: In member function âv8::Handle<v8::Value> Function::CharToExternal(CHND, const SAP_UC*, v8::Handle<v8::Value>, unsigned int)â: ../src/Function.cc:561:27: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (valueU16.length() > len) { ^ ../src/Function.cc: In member function âv8::Handle<v8::Value> Function::ByteToExternal(CHND, const SAP_UC*, v8::Handle<v8::Value>, unsigned int)â: ../src/Function.cc:584:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (valueAscii.length() > len) { ^ SOLINK(target) Release/obj.target/sapnwrfc.node /usr/bin/ld: cannot find -lsapnwrfc /usr/bin/ld: cannot find -lsapucum collect2: error: ld returned 1 exit status make: *** [Release/obj.target/sapnwrfc.node] Error 1 make: Leaving directory/usr/node_modules/sapnwrfc/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23) gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12) gyp ERR! System Linux 3.13.0-48-generic gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /usr/node_modules/sapnwrfc gyp ERR! node -v v0.10.20 gyp ERR! node-gyp -v v0.10.10 gyp ERR! not ok sapnwrfc@0.1.5 node_modules/sapnwrfc âââ bindings@0.3.0

agebert commented 9 years ago

If node is 64-bit I think you have to copy the SAP libs to /usr/lib64.

I use another way to compile it. It is explained here https://github.com/jdorner/node-sapnwrfc/pull/7 .

StefanScherer commented 9 years ago

Installing the libs to /usr/lib and includes to /usr/include works fine for me in a Docker container, also 64bit Linux. Perhaps your system needs a sudo ldconfig to find the new libs.

pRatikSathaye commented 8 years ago

I tried both of the options i.e. putting SAP libs to /usr/lib64 and /usr/lib. But I am getting below error

> sapnwrfc@0.2.0 install /home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc
> node preinstall.js

{ [Error: Could not locate the bindings file. Tried:
 → /home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/build/sapnwrfc.node
 → /home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/build/Debug/sapnwrfc.node
 → /home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/build/Release/sapnwrfc.node
 → /home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/out/Debug/sapnwrfc.node
 → /home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/Debug/sapnwrfc.node
 → /home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/out/Release/sapnwrfc.node
 → /home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/Release/sapnwrfc.node
 → /home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/build/default/sapnwrfc.node
 → /home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/compiled/0.12/linux/x64/sapnwrfc.node]
  tries: 
   [ '/home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/build/sapnwrfc.node',
     '/home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/build/Debug/sapnwrfc.node',
     '/home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/build/Release/sapnwrfc.node',
     '/home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/out/Debug/sapnwrfc.node',
     '/home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/Debug/sapnwrfc.node',
     '/home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/out/Release/sapnwrfc.node',
     '/home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/Release/sapnwrfc.node',
     '/home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/build/default/sapnwrfc.node',
     '/home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/compiled/0.12/linux/x64/sapnwrfc.node' ] }
error a precompiled module could not be found or loaded
info trying to compile it...
make: Entering directory `/home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/build'
  CXX(target) Release/obj.target/sapnwrfc/src/binding.o
  CXX(target) Release/obj.target/sapnwrfc/src/Connection.o
  CXX(target) Release/obj.target/sapnwrfc/src/Function.o
  SOLINK(target) Release/obj.target/sapnwrfc.node
  COPY Release/sapnwrfc.node
make: Leaving directory `/home/pratik/Projects/Test/source/TestConnector/node_modules/sapnwrfc/build'
sapnwrfc@0.2.0 node_modules/sapnwrfc
├── bindings@1.2.1
└── nan@2.1.0
StefanScherer commented 8 years ago

@pRatikSathaye the build steps seems normal to me. The preinstall.js does not find a precompiled binding as you use Node 0.12. Then it compiles it. The module should be usable afterwards. You can use Node 4 or 5 to suppress this compilation step as the npm module has precompiled bindings for these versions.

pRatikSathaye commented 8 years ago

Yes, I am able to use the module. Thanks @StefanScherer

hikmettenis1 commented 8 years ago

I got node 4.2.4 and still having the same problem.

hikmettenis1 commented 8 years ago

actually, Im getting now this:

C:\Hikmet\300\server\node_modules\sapnwrfc>if not defined npm_config_node_gyp (n ode "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin....\node _modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild ) Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targ ets(356,5): error MSB6006: "CL.exe" exited with code -1073741515. [C:\Hikmet\30 0\server\node_modules\sapnwrfc\build\sapnwrfc.vcxproj] gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe fail ed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_mo dules\npm\node_modules\node-gyp\lib\build.js:270:23) gyp ERR! stack at emitTwo (events.js:87:13) gyp ERR! stack at ChildProcess.emit (events.js:172:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_proces s.js:200:12) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "reb uild" gyp ERR! cwd C:\Hikmet\300\server\node_modules\sapnwrfc gyp ERR! node -v v4.2.4 gyp ERR! node-gyp -v v3.0.3 gyp ERR! not ok sapnwrfc@0.2.0 node_modules\sapnwrfc ├── bindings@1.2.1 └── nan@2.3.5