SAP / node-rfc

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

Platform not supported win32 x64 #3

Closed joystick closed 8 years ago

joystick commented 9 years ago

Hi, i see the following error:

C:\Users\ak\Documents\code\sap>node
> var rfc = require('node-rfc')
Platform not supported win32 x64
undefined
> process.platform
'win32'
> process.arch
'x64'
>
C:\Users\ak\Documents\code\sap>

Please advise what can be wrong.

Thank you, Alexei

joystick commented 9 years ago

Just found that code works with .0.10.32 and not works with 0.12.2. Anything can be done about this? Thank you, Alexei

bsrdjan commented 9 years ago

Hi Alexei, nodejs C++ API changed considerably in version 0.12, not backwards compatible, thus a bigger rework required, also a more descriptive error message in this case. I leave this issue open until support for 0.12 provided, will look into that. Kind regards, srdjan

joystick commented 9 years ago

Hi Srdjan, Thanks for prompt and clear reply. I will work with 0.10 for the time being. And thank you for package as well - it seems to be very clear how to use it. Best regards, Alexei

joystick commented 9 years ago

Hi Srdjan, Just noticed that while working on 0.10.32

C:\Users\ak\Documents\code\sap>node -v
v0.10.32

C:\Users\ak\Documents\code\sap>node
> var rfc = require('node-rfc')
undefined
> console.log(rfc)
{ Client: [Function: Client] }
undefined
>

package is not loading on 0.10.36:

C:\Users\ak\AppData\Local\.meteor\packages\meteor-tool\1.1.2\mt-os.windows.x86_3
2\dev_bundle\bin>node -v
v0.10.36

C:\Users\ak\AppData\Local\.meteor\packages\meteor-tool\1.1.2\mt-os.windows.x86_3
2\dev_bundle\bin>node
> var rfc = require('node-rfc')
undefined
> console.log(rfc)
null
undefined
>

Is it possible to take a look at it? I'm limited to 0.10.36 since it's bundled with Meteor and I can't really change it to 0.10.32 at the moment.

Thank you, Alexei

bsrdjan commented 9 years ago

Hi Alexei, one of the reasons for not loading could be that SAP NW RFC Lib is not installed or its lib subdirectory not on PATH, like described here: http://sap.github.io/node-rfc/install.html#sap-nw-rfc-library-installation Could you please check that first? Kind regards, srdjan

bsrdjan commented 9 years ago

Hi Alexey, just tested 0.10.36 on Windows 7 64 bit, no issues. Another cause can be using the node version manager like nodist, which in some cases installs the 32 bit node version per default and 32 bit nodejs is not loading 64 bit SAP NW RFC lib. Regards, srdjan

joystick commented 9 years ago

Hello Srdjan, Your second idea is correct. Meteor is bundled with ia32 version of node. I'm asking maintainers if it's possible to bundle it with x64. Thanks again for prompt replies and great support. Best regards, Alexei

joystick commented 9 years ago

Srdjan, Meteor installer for windows maintainers don't have reasons to bundle it with 64bit version of node. They want one installer to work on 32 and 64 bit windows. Therefore may I kindly ask you to build an ia32 version of extension? Thank you very much in advance. Alexei

fitzecarraldo76 commented 9 years ago

Hi, I am having the same error message "Platform not supported win32 x64" with Node 0.12.7 on windows 7 (my Node version is x64 so the above solution doesn't help). Also the lib is in the path and running it via command line works (startrfc.exe eg.) Did anyone have this version of node running with the rfc lib?

Cheers Sebastian

bsrdjan commented 9 years ago

Hi Sebastian, node 12 is not supported yet as c-api changed considerably. Changes are not backwards compatible and the migration requires more efforts. I did not have enough free capacity and hope start working in this soon. Regards, Srdjan

fitzecarraldo76 commented 9 years ago

Hi Srdjan, Thanks for the quick reply, i will try with the lower version 0.10.36 then ;) With best regards Sebastian

bsrdjan commented 9 years ago

just released the upgrade for 0.12 api in the master branch and the compiled binary for linux 64 bit. please feel free to test.

japel commented 9 years ago

I'm having the same issue with: -Windows 7 64bit -Node v0.10.38 (64bit)

I downloaded and unpacked SAP NW RFC Library Installation for windows x64 under C:\nwrfcsdk and C:\nwrfcsdk\lib is in my PATH environment variable.

Any idea why it could be failing?

The error object in the catch statement says: Das angegebene Modul wurde nicht gefunden. d:\dev\saprfctest\node_modules\node-rfc\build\win32_x64\rfc.node Which means something like "the specified module could not be found", but the file is there.

ksarpotdar commented 8 years ago

When would we get the working code for node-rfc by SAP? I am getting a error "Specified Procedure Could not be found" and then it throws the platform not supported error". I am using Nodejs 4.1.0 platform win32_x64. I suspect it is not able to find the "Client" procedure. I would appreciate help in resolving this and using the SAP-NODE-RFC

bsrdjan commented 8 years ago

Packaging and publishing nodejs binary modules was long discussed, see also the issue #8. Until we switch to node-pre-gyp or similar, could you please try to use pre-compiled Windows binaries like in test\test.js:

var rfc = require('./../build/win32_x64/rfc-v4.1.2.node');

All win64 builds passed unit tests and should work on your platform and node version as well. Hope this intermediate solution helps.

ksarpotdar commented 8 years ago

Dear Srdjan Boskovic, Thanks a lot! Very much appreciated! I could not find this folder earlier. This is perfectly working now. Great work! regards

victorhsn commented 8 years ago

Hi, I did the download of the demo...but when I'll execute the script there is a wrong that I don't understand why is returning...

/Users/Victor/Documents/Estudos/sapnode/conect.js:12 var client = new rfc.Client(abapSystem); ^

TypeError: Cannot read property 'Client' of null at Object. (/Users/Victor/Documents/Estudos/sapnode/conect.js:12:21) at Module._compile (module.js:435:26) at Object.Module._extensions..js (module.js:442:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:311:12) at Function.Module.runMain (module.js:467:10) at startup (node.js:136:18) at node.js:963:3 Victors-MacBook-Pro:sapnode Victor$

Thank you...

bsrdjan commented 8 years ago

Are you requiring the correct rfc.node for your nodejs version and platform ?

I recently published Windows 64 builds for several nodejs versions and the demo.js shall be adapted like in mine last comment above.

If still does not work, could you please attach the full source ? The backend system parameters must be adapted as well.

japel commented 8 years ago

Back then I was able to solve my issue by copying the whole nwrfcsdk/lib folder content to C:\Windows\System32 so it was probably some path issue... But I think my issue has nothing to do with yours... But you can give it a try. For OS other than Windows, check if the libs exists and can be found.

victorhsn commented 8 years ago

Sorry Boskovic,but I'm using the OS X and this topic is about the WIN32*, but I'll paste here my code... So, I'd installed the node-rfc with following command: npm install -g node-rfc, and I'd success... But when I said, when I'll execute the command: node conect.js, the program return a mistake... My code is:

var rfc = require('node-rfc'); var abapSystem = { user: 'abap', passwd: 'xxxxx', ashost: '192.168.10.10', sysnr: '00', client: '050', };

// create new client var client = new rfc.Client(abapSystem);

Thank you...

bsrdjan commented 8 years ago

Hi Victor,

the node-rfc is not supported on OSX because the SAP NW RFC Library is currently not available on OSX, see "Platform and Prerequisites" section in README.

The npm install -g node-rfc technically works on OSX because the node-rfc package published a while ago on npm, is built following the old style of building multi-platform binary npm packages.

That package shall be anyway removed and published following current best practices, which requires more work and testing. Until that us available and, perhaps, the OSX version, only Windows and Linux remain, eventually as virtual machines on OSX.

Best regards, srdjan

victorhsn commented 8 years ago

Hi, Srdjan.. I'm so sorry, I'd understood wrong...

Trank you.

bsrdjan commented 8 years ago

Closed.

jug124 commented 6 years ago

Hi bsrdjan I extracted NWRFC_38-20004568.SAR and I appended "C:\nwrfcsdk\lib" in PATH system. I have got error; var rfc = require('node-rfc'); undefined

I am not sure how can I fix it? I installed node js version 8.11.3

Is it possible that NWRFC_38-20004568.SAR support other nodejs version?

thank you for your help Jakarin

bsrdjan commented 6 years ago

Hi Jakarin, any node-rfc version can be used with any SAP NW RFC SDK version, no restrictions. SAP NW RFC SDK is fully backwards compatible and using the latest version is recommended. Your snippet does not look as an error to me. What happens after you type "rfc" and press ENTER? If SAP NW RFC SDK and node-rfc are properly installed, the output should be something like:

> var rfc = require('./lib')
undefined
> rfc
[Function: RfcClient]

If there is an issue, could you please open new issue? It helps other users', when searching for solutions. Kind regards, Srdjan