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 run on Windows 10 #115

Closed
gabenunez opened this issue Dec 7, 2019 · 15 comments
Closed

Unable to run on Windows 10 #115

gabenunez opened this issue Dec 7, 2019 · 15 comments

Comments

@gabenunez
Copy link

Currently unable to get running on Windows 10.

I've ran through the steps listed here and keep running into the following error when I attempt to run my script.

Capture

I've went as far as downgrading Node to v8.16.1 (currently setup on a remote server and running successfully). Ran through my paths and uninstalled and reinstalling the package.

Any help would be super great!

@bsrdjan
Copy link
Contributor

bsrdjan commented Dec 7, 2019

Did you test the SAP NWRFC SDK installation by running rfcexec.exe, like described in section Test ?

If installed correctly, the output should be like:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\bsrdjan>cd %SAPNWRFC_HOME%

C:\Tools\nwrfcsdk>cd bin

C:\Tools\nwrfcsdk\bin>rfcexec.exe
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.

C:\Tools\nwrfcsdk\bin>

@gabenunez
Copy link
Author

@bsrdjan I can confirm that's the output I'm getting, log below.

Microsoft Windows [Version 10.0.18362.476]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\gnunez>cd %SAPNWRFC_HOME%

C:\nwrfcsdk>cd bin

C:\nwrfcsdk\bin>rfcexec.exe
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.

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)

@bsrdjan
Copy link
Contributor

bsrdjan commented Dec 8, 2019

SAP NWRFC SDK is correctly installed. Could you please uninstall the node-rfc from your project, run the npm install node-rfc again and post the installation log?

@gabenunez
Copy link
Author

@bsrdjan Please see below.

PS C:\Users\gnunez\projects\ebayfeed\tracking> npm i node-rfc

> node-rfc@1.0.3 preinstall C:\Users\gnunez\projects\ebayfeed\node_modules\node-rfc
> npm install cmake-js prebuild-install prebuild node-addon-api

npm notice created a lockfile as package-lock.json. You should commit this file.
+ node-addon-api@1.7.1
+ prebuild-install@5.3.3
+ cmake-js@5.3.2
+ prebuild@9.1.1
added 245 packages from 209 contributors and audited 1205 packages in 14.807s
found 0 vulnerabilities


> node-rfc@1.0.3 install C:\Users\gnunez\projects\ebayfeed\node_modules\node-rfc
> prebuild-install --tag-prefix -r napi || npm run prebuild

npm WARN apitodb@1.0.0 No repository field.

+ node-rfc@1.0.3
added 2 packages from 45 contributors and audited 2513 packages in 20.363s
found 0 vulnerabilities

@bsrdjan
Copy link
Contributor

bsrdjan commented Dec 8, 2019

All looks correct, the package downloaded from npm, no build from source. Just tested in VS2019 and x86 Power Shells and all works:

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

Which node version are you using and what is the output of node -e "console.log(process.arch)" ?

@gabenunez
Copy link
Author

@bsrdjan I was originally on v8.16.1, but just re-upgraded to the latest v12.13.1.

Running that returns x64.

@bsrdjan
Copy link
Contributor

bsrdjan commented Dec 9, 2019

Tried again with node 12.13.1 and could not reproduce.

Could you please check if all files present in node_modules\node-rfc\lib folder, like:

Screenshot 2019-12-09 at 11 59 58

What happens if sapnwrfc.node requested directly:

cd node_modules\node-rfc\lib\binding
node -e "console.log(require('.\sapnwrfc.node'))"

@gabenunez
Copy link
Author

C:.
│   index.d.ts
│   index.js
│   index.js.map
│   
├───binding
│       sapnwrfc.node
│       
└───wrapper
        sapnwrfc-client.d.ts
        sapnwrfc-client.js
        sapnwrfc-client.js.map
        sapnwrfc-pool.d.ts
        sapnwrfc-pool.js
        sapnwrfc-pool.js.map

Looks like files are present.

Oddly enough, when I request it directly it can not find the module.

PS C:\Users\gnunez\projects\ebayfeed\node_modules\node-rfc\lib\binding> node -e "console.log(require('sapnwrfc.node'))"
internal/modules/cjs/loader.js:800
    throw err;
    ^

Error: Cannot find module 'sapnwrfc.node'
Require stack:
- C:\Users\gnunez\projects\ebayfeed\node_modules\node-rfc\lib\binding\[eval]
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at require (internal/modules/cjs/helpers.js:74:18)
    at [eval]:1:13
    at Script.runInThisContext (vm.js:116:20)
    at Object.runInThisContext (vm.js:306:38)
    at Object.<anonymous> ([eval]-wrapper:9:26)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at evalScript (internal/process/execution.js:80:25) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\gnunez\\projects\\ebayfeed\\node_modules\\node-rfc\\lib\\binding\\[eval]'
  ]
}
PS C:\Users\gnunez\projects\ebayfeed\node_modules\node-rfc\lib\binding> node -e "console.log(require('.\sapnwrfc.node'))"
internal/modules/cjs/loader.js:800
    throw err;
    ^

Error: Cannot find module '.sapnwrfc.node'
Require stack:
- C:\Users\gnunez\projects\ebayfeed\node_modules\node-rfc\lib\binding\[eval]
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:797:15)
    at Function.Module._load (internal/modules/cjs/loader.js:690:27)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at [eval]:1:13
    at Script.runInThisContext (vm.js:116:20)
    at Object.runInThisContext (vm.js:306:38)
    at Object.<anonymous> ([eval]-wrapper:9:26)
    at Module._compile (internal/modules/cjs/loader.js:959:30)
    at evalScript (internal/process/execution.js:80:25) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\gnunez\\projects\\ebayfeed\\node_modules\\node-rfc\\lib\\binding\\[eval]'
  ]
}

@bsrdjan
Copy link
Contributor

bsrdjan commented Dec 9, 2019

With double backslash should work, like:

 node -e "console.log(require('.\\sapnwrfc.node'))"

Which VC redistributable is installed?

@gabenunez
Copy link
Author

Thar seems to have went further.

PS C:\Users\gnunez\projects\ebayfeed\node_modules\node-rfc\lib\binding> node -e "console.log(require('.\\sapnwrfc.node'))"       
internal/modules/cjs/loader.js:1025
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The specified procedure could not be found.
\\?\C:\Users\gnunez\projects\ebayfeed\node_modules\node-rfc\lib\binding\sapnwrfc.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1025:18)
    at Module.load (internal/modules/cjs/loader.js:815:32)
    at Function.Module._load (internal/modules/cjs/loader.js:727:14)
    at Module.require (internal/modules/cjs/loader.js:852:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at [eval]:1:13
    at Script.runInThisContext (vm.js:116:20)
    at Object.runInThisContext (vm.js:306:38)
    at Object.<anonymous> ([eval]-wrapper:9:26)
    at Module._compile (internal/modules/cjs/loader.js:959:30)

I just removed all previous versions of VC redistributable and installed the version listed here. I'm currently on 14.0.23026.0

@Berdmanfolk
Copy link

I have the same error on windows 10

@drgif
Copy link

drgif commented Dec 27, 2019

I am getting the same error on Windows 10 for a few weeks now too, but I am able to run on Windows Server 2012 R2 Standard. I have tried a couple of combinations:

  • Windows 10 Enterprise (with Creators Update), Node v12.13.1, node-rfc 1.0.3: Not working

  • Windows Server 2019 Datacenter, Node v10.15.0, node-rfc 1.0.0-rc7: Not working

  • --- same machine ---, node-rfc 1.0.3: Not working

  • --- same machine ---, Node v12.13.1, node-rfc 1.0.3: Not working

  • Windows Server 2012 R2 Standard, Node v10.15.0, node-rfc: 1.0.0-rc7: Working!

The issue on my Windows 10 Enterprise could well have started around the time I installed Creators Update. Maybe it has something to do with that?
If you need more information or would like me to try other configurations, I will do my best to provide them.

Oh, and I cannot reproduce the result from @gabenunez two posts ago on my Windows 10 machine (haven't tried on the others).

Thank you so much for looking into this!

@drgif
Copy link

drgif commented Jan 2, 2020

Ok, I fixed it for our machines and it seems like there were two problems:

  • The first was node-rfc 1.0.3: I get the above error with version 1.0.0 and 1.0.3. Version 1.0.0-rc7 did fine in the past and when I installed 1.0.0-rc11 (the current node-rfc@next) it worked again.
    Except:
  • The second problem only manifested on the Windows Server 2019 Datacenter. After installing 1.0.0-rc11 the error message changed slightly, now complaining that it could not find the SAPNWRFC libraries. However, those were correctly installed and found by the process. Using the process monitor we found that sapnwrfc.node was also looking for MSVCP120.dll (Visual C++ 2013 Redistributable) which was not installed on the system (see attached screenshot). That lead to the crash and the (false) error message about the SAPNWRFC libraries.
    Inked2020-01-02 15_45_00-Process Monitor CENS

Installing the VC++ 2013 Redistributable from the Microsoft Website fixed the problem.

@fredimartins
Copy link
Contributor

see this
#119

@bsrdjan
Copy link
Contributor

bsrdjan commented Mar 2, 2020

Solution documented in #119 (comment), will update the README well

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

5 participants