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

Unable to install node-rfc in Windows 10 #78

Closed
rahul4sap opened this issue Mar 10, 2019 · 10 comments
Closed

Unable to install node-rfc in Windows 10 #78

rahul4sap opened this issue Mar 10, 2019 · 10 comments

Comments

@rahul4sap
Copy link

Hi All,

Not sure what wrong I am doing but I am not able to install node-rfc module in my Windows 10 machine.

Below are the steps I followed:

  1. Downloaded SDK 750 from SAP service marketplace and extracted the zip into C:\nwrfcsdk (as mentioned in the link

  2. Set the environment variables as mentioned below.

image

  1. Set the environment variable for NODE_PATH

set NODE_PATH=C:\Users\guptar29\AppData\Roaming\npm\node_modules

  1. cd to my coding folder where performed npm install node-rfc where it throws bunch of error - mentioned below

image

Kindly help!

Thanks,
Rahul

@bsrdjan
Copy link
Contributor

bsrdjan commented Mar 11, 2019

The npm install node-rfc tries to install the old node-rfc release, for which only critical fixes are maintained. That node-rfc release does not support newer node versions, like node 10 used on your system and when the node-rfc installation package not found on npm, the installer tries to build it from source on your system.

As the log shows, the build fails because it requires Python 2 (Known Issues) and on your system the Python 3 is used.

As a solution I would recommend using the current node-rfc release, available as a prerelease, with many bugs fixes, improvements and new features (README):

npm install node-rfc@next

The build is provided for node 10 and the installer should not complain about the Python 3.

@rahul4sap
Copy link
Author

Thanks for your reply. I installed now node-rfc@next but now I am getting different error when trying to call this module in Node - below screenshot.

Error: The specified module could not be found. \\?\node_modules\node-rfc\lib\binding\win32-x64-node-v64\sapnwrfc.node

image

Appreciate your help in advance.

Thanks,
Rahul

@bsrdjan
Copy link
Contributor

bsrdjan commented Mar 12, 2019

Could you please create the new project from scratch (run npm init in new folder and confirm all defaults) and post the full log of:

node -v
npm install node-rfc@next
node -e "console.log(require('node-rfc'))"

Here how it looks on one Windows test system:

λ node -v
v10.15.0

λ npm i node-rfc@next

> node-rfc@1.0.0-rc7 preinstall C:\src\test-node-rfc\node_modules\node-rfc
> npm install node-pre-gyp node-addon-api

npm notice created a lockfile as package-lock.json. You should commit this file.
+ node-addon-api@1.6.2
+ node-pre-gyp@0.12.0
added 1 package from 32 contributors, updated 4 packages and audited 96 packages in 2.876s
found 0 vulnerabilities


> node-rfc@1.0.0-rc7 install C:\src\test-node-rfc\node_modules\node-rfc
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
[node-rfc] Success: "C:\src\test-node-rfc\node_modules\node-rfc\lib\binding\win32-x64-node-v64\sapnwrfc.node" is installed via remote
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN test-node-rfc@1.0.0 No description
npm WARN test-node-rfc@1.0.0 No repository field.

+ node-rfc@1.0.0-rc7
added 75 packages from 61 contributors and audited 104 packages in 9.66s
found 0 vulnerabilities


C:\src\test-node-rfc  (test-node-rfc@1.0.0)
λ node -e "console.log(require('node-rfc'))"
{ Client: [Function: Client], Pool: [Function: Pool] }

@rahul4sap
Copy link
Author

Hi - Please find below error logs.

guptar29@INITGUPTAR2L1C MINGW64 ~/Documents/Code/node-rfc-demo-test
$ node -v
v10.15.1

guptar29@INITGUPTAR2L1C MINGW64 ~/Documents/Code/node-rfc-demo-test
$ npm install node-rfc@next

> node-rfc@1.0.0-rc7 preinstall C:\Users\guptar29\Documents\Code\node-rfc-demo-test\node_modules\node-rfc
> npm install node-pre-gyp node-addon-api

npm notice created a lockfile as package-lock.json. You should commit this file.
+ node-pre-gyp@0.12.0
+ node-addon-api@1.6.2
added 1 package from 32 contributors, updated 4 packages and audited 96 packages in 1.593s
found 0 vulnerabilities


> node-rfc@1.0.0-rc7 install C:\Users\guptar29\Documents\Code\node-rfc-demo-test\node_modules\node-rfc
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download
[node-rfc] Success: "C:\Users\guptar29\Documents\Code\node-rfc-demo-test\node_modules\node-rfc\lib\binding\win32-x64-node-v64\sapnwrfc.node" is installed via remote
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN node-rfc-demo-test@1.0.0 No description
npm WARN node-rfc-demo-test@1.0.0 No repository field.

+ node-rfc@1.0.0-rc7
added 75 packages from 61 contributors and audited 104 packages in 13.744s
found 0 vulnerabilities


guptar29@INITGUPTAR2L1C MINGW64 ~/Documents/Code/node-rfc-demo-test
$ node -e "console.log(require('node-rfc'))"
C:\Users\guptar29\Documents\Code\node-rfc-demo-test\node_modules\node-rfc\lib\wrapper\sapnwrfc-client.js:26
    throw ex;
    ^

Error: The specified module could not be found.
\\?\C:\Users\guptar29\Documents\Code\node-rfc-demo-test\node_modules\node-rfc\lib\binding\win32-x64-node-v64\sapnwrfc.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\guptar29\Documents\Code\node-rfc-demo-test\node_modules\node-rfc\lib\wrapper\sapnwrfc-client.js:9:15)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\guptar29\Documents\Code\node-rfc-demo-test\node_modules\node-rfc\lib\index.js:6:10)
    at Module._compile (internal/modules/cjs/loader.js:689:30)

Thanks,
Rahul

@bsrdjan
Copy link
Contributor

bsrdjan commented Mar 12, 2019

The error message is telling that following file is for some reason missing on your system:

node-rfc-demo-test\node_modules\node-rfc\lib\binding\win32-x64-node-v64\sapnwrfc.node

Looking into node-rfc rc7 release package, the file is included and should be installed by npm install node-rfc@next.

I don't have a Windows 10 system atm. to test, but could you please try following.

Check the folder structure of node-rfc-demo-test\node_modules\node-rfc\lib\binding. It should look like below and sapnwrfc.node should be in the win32-x64-node-v64 folder:
Screenshot 2019-03-12 at 20 30 07

If the folder or the file missing, could you please post the screenshot or the tree listing, like:

Screenshot 2019-03-12 at 20 09 13

I can check on Windows 10 if there is possibly an installation bug. As a quick workaround, you can download the rfc-win32-x64-node-v64.tar.gz into node-rfc-demo-test\node_modules\node-rfc\lib\binding folder and unpack, to create the missing file.

I will try to reproduce on Windows 10.

@rahul4sap
Copy link
Author

Surprisingly, this file sapnwrfc.node is already there in the folder \node_modules\node-rfc\lib\binding\win32-x64-node-v64\ but still it throws that error.

C:\Users\guptar29\Documents\Code\node-rfc-demo-test\node_modules\node-rfc\lib\wrapper\sapnwrfc-client.js:26
    throw ex;
    ^

Error: The specified module could not be found.
\\?\C:\Users\guptar29\Documents\Code\node-rfc-demo-test\node_modules\node-rfc\lib\binding\win32-x64-node-v64\sapnwrfc.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\guptar29\Documents\Code\node-rfc-demo-test\node_modules\node-rfc\lib\wrapper\sapnwrfc-client.js:9:15)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at Object.<anonymous> (C:\Users\guptar29\Documents\Code\node-rfc-demo-test\node_modules\node-rfc\lib\index.js:6:10)
    at Module._compile (internal/modules/cjs/loader.js:689:30)

I tried the workaround but still no luck - Getting same error even after unpacking the .tar file.

Below are the screenshots which you asked.

image

image

@bsrdjan
Copy link
Contributor

bsrdjan commented Mar 14, 2019

I reproduced the error by moving SAP NW RFC SDK library out of the PATH. The error message is complaining about that "module", not the node module, will add the case in documentation.

Could you please check the SAP NW RFC SDK library installation, in a following way:

  1. The PATH points to SAP NW RFC SDK root folder. This looks correct on your first screenshot.

  2. Check if files are indeed there, should look something like:

Screenshot 2019-03-14 at 19 50 56

  1. If files are there, please check if SAP NW RFC SDK properly installed by running the rfcexec in bin folder. The output should be error message like below, complaining about parameters. If the popup or message comes up about not finding the DLL, something is wrong with the library installation.
$ cd %SAPNWRFC_HOME%/bin
$ rfcexec
Error: Not all mandatory parameters specified
        Please start the program in the following way:
        rfcexec -t -a <program ID> -g <gateway host> -x <gateway service>
                -f <file with list of allowed commands> -s <allowed Sys ID>
The options "-t" (trace), "-f" and "-s" are optional.

If the output is different, could you please check if the correct SAP NW RFC SDK is downloaded for your platform? Could it be that your platform is 64 bit and 32 bit SAP NW RFC SDK downloaded? OR the 32 bit nodejs used, set by node version manager perhaps? You could also send me the link or screenshot of the location from which the SAP NW RFC SDK is downloaded.

@rahul4sap
Copy link
Author

You were right!! My SDK version was not correct (had this nwrfc750P_3-70002726) hence this error. I downloaded the correct one now (nwrfc750P_3-70002755) from Service Marketplace and it worked well.

I have few other question as how can we use this on cloud foundry for which I will raise a new thread.

Thanks again mate

@cocolucio
Copy link

cocolucio commented Oct 8, 2019

Hi! Im facing the same issue here and I tried with the version "nwrfc750P_3-70002755" which is not working for me. I wonder which version is for 64 or 32 bit.

I also tried with version "nwrfc750P_5-70002726.zip"

BTW I have Windows 10 64 bits

@bsrdjan
Copy link
Contributor

bsrdjan commented Oct 9, 2019

Following node-rfc README Prerequisites for all platforms it should be straightforward (relatively :)):

More information on SAP NW RFC SDK section on SAP Support Portal:
https://support.sap.com/en/product/connectors/nwrfcsdk.html:
Screenshot 2019-10-09 at 13 09 24

SAP Note 2573790
Screenshot 2019-10-09 at 13 11 29

Service Marketplace
Screenshot 2019-10-09 at 13 12 31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants