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

node-gyp not working with node 18.12.1 #2806

Closed
MRayermannMSFT opened this issue Feb 27, 2023 · 16 comments
Closed

node-gyp not working with node 18.12.1 #2806

MRayermannMSFT opened this issue Feb 27, 2023 · 16 comments
Labels

Comments

@MRayermannMSFT
Copy link

  • Node Version: 18.12.1 / 8.19.2
  • Platform:
    OS Name: Microsoft Windows 11 Enterprise
    OS Version: 10.0.22621 N/A Build 22621
    System Type: ARM64-based PC
    (issue seen on multiple Windows machines)
  • Compiler:
    MSBuild version 17.6.0-preview-23077-01+5f95887e0 for .NET Framework
    17.6.0.7701Microsoft (R) C/C++ Optimizing Compiler Version 19.36.32323 for x86
    Copyright (C) Microsoft Corporation. All rights reserved.
  • Module: various modules

I've been trying to rebuild native modules against Node 18.12.1, using headers for Electron 23.1.1. Things work fine on macOS and Linux. However on Windows, node-gyp frequently fails to extract headers successfully. What I have pasted below is the most common error. I have also seen node-gyp think a header did not exist after extraction, even though it does. Let me know if you'd like that error output as well.

Verbose output (from npm or node-gyp):
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'D:\\a\\_work\\_tool\\node\\18.12.1\\x64\\node.exe',
npm ERR! gyp verb cli   'D:\\a\\_work\\_tool\\node\\18.12.1\\x64\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild'
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@9.1.0
npm ERR! gyp info using node@18.12.1 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb download using dist-url https://electronjs.org/headers
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - "python3" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if "python" can be used
npm ERR! gyp verb find Python - executing "python" to get executable path
npm ERR! gyp verb find Python - "python" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if Python is C:\Users\cloudtest\AppData\Local\Programs\Python\Python39\python.exe
npm ERR! gyp verb find Python - executing "C:\Users\cloudtest\AppData\Local\Programs\Python\Python39\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Users\cloudtest\AppData\Local\Programs\Python\Python39\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Program Files\Python39\python.exe
npm ERR! gyp verb find Python - executing "C:\Program Files\Python39\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Program Files\Python39\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Users\cloudtest\AppData\Local\Programs\Python\Python39-32\python.exe
npm ERR! gyp verb find Python - executing "C:\Users\cloudtest\AppData\Local\Programs\Python\Python39-32\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Users\cloudtest\AppData\Local\Programs\Python\Python39-32\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Program Files\Python39-32\python.exe
npm ERR! gyp verb find Python - executing "C:\Program Files\Python39-32\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Program Files\Python39-32\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Program Files (x86)\Python39-32\python.exe
npm ERR! gyp verb find Python - executing "C:\Program Files (x86)\Python39-32\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Program Files (x86)\Python39-32\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Users\cloudtest\AppData\Local\Programs\Python\Python38\python.exe
npm ERR! gyp verb find Python - executing "C:\Users\cloudtest\AppData\Local\Programs\Python\Python38\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Users\cloudtest\AppData\Local\Programs\Python\Python38\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Program Files\Python38\python.exe
npm ERR! gyp verb find Python - executing "C:\Program Files\Python38\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Program Files\Python38\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Users\cloudtest\AppData\Local\Programs\Python\Python38-32\python.exe
npm ERR! gyp verb find Python - executing "C:\Users\cloudtest\AppData\Local\Programs\Python\Python38-32\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Users\cloudtest\AppData\Local\Programs\Python\Python38-32\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Program Files\Python38-32\python.exe
npm ERR! gyp verb find Python - executing "C:\Program Files\Python38-32\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Program Files\Python38-32\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Program Files (x86)\Python38-32\python.exe
npm ERR! gyp verb find Python - executing "C:\Program Files (x86)\Python38-32\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Program Files (x86)\Python38-32\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Users\cloudtest\AppData\Local\Programs\Python\Python37\python.exe
npm ERR! gyp verb find Python - executing "C:\Users\cloudtest\AppData\Local\Programs\Python\Python37\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Users\cloudtest\AppData\Local\Programs\Python\Python37\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Program Files\Python37\python.exe
npm ERR! gyp verb find Python - executing "C:\Program Files\Python37\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Program Files\Python37\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Users\cloudtest\AppData\Local\Programs\Python\Python37-32\python.exe
npm ERR! gyp verb find Python - executing "C:\Users\cloudtest\AppData\Local\Programs\Python\Python37-32\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Users\cloudtest\AppData\Local\Programs\Python\Python37-32\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Program Files\Python37-32\python.exe
npm ERR! gyp verb find Python - executing "C:\Program Files\Python37-32\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Program Files\Python37-32\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Program Files (x86)\Python37-32\python.exe
npm ERR! gyp verb find Python - executing "C:\Program Files (x86)\Python37-32\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Program Files (x86)\Python37-32\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Users\cloudtest\AppData\Local\Programs\Python\Python36\python.exe
npm ERR! gyp verb find Python - executing "C:\Users\cloudtest\AppData\Local\Programs\Python\Python36\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Users\cloudtest\AppData\Local\Programs\Python\Python36\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Program Files\Python36\python.exe
npm ERR! gyp verb find Python - executing "C:\Program Files\Python36\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Program Files\Python36\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Users\cloudtest\AppData\Local\Programs\Python\Python36-32\python.exe
npm ERR! gyp verb find Python - executing "C:\Users\cloudtest\AppData\Local\Programs\Python\Python36-32\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Users\cloudtest\AppData\Local\Programs\Python\Python36-32\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Program Files\Python36-32\python.exe
npm ERR! gyp verb find Python - executing "C:\Program Files\Python36-32\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Program Files\Python36-32\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Program Files (x86)\Python36-32\python.exe
npm ERR! gyp verb find Python - executing "C:\Program Files (x86)\Python36-32\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Program Files (x86)\Python36-32\python.exe" could not be run
npm ERR! gyp verb find Python checking if the py launcher can be used to find Python 3
npm ERR! gyp verb find Python - executing "py.exe" to get Python 3 executable path
npm ERR! gyp verb find Python - executable path is "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe"
npm ERR! gyp verb find Python - executing "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe" to get version
npm ERR! gyp verb find Python - version is "3.9.13"
npm ERR! gyp info find Python using Python version 3.9.13 found at "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\python.exe"
npm ERR! gyp verb get node dir compiling against --target node version: 23.1.1
npm ERR! gyp verb command install [ '23.1.1' ]
npm ERR! gyp verb download using dist-url https://electronjs.org/headers
npm ERR! gyp verb install input version string "23.1.1"
npm ERR! gyp verb install installing version: 23.1.1
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 0
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is no good; reinstalling
npm ERR! gyp verb ensuring nodedir is created C:\Users\cloudtest\AppData\Local\node-gyp\Cache\23.1.1
npm ERR! gyp http GET https://electronjs.org/headers/v23.1.1/node-v23.1.1-headers.tar.gz
npm ERR! gyp http 200 https://artifacts.electronjs.org/headers/v23.1.1/node-v23.1.1-headers.tar.gz?force_headers_dist=1
npm ERR! gyp verb extracted file from tarball node_headers/include/node/common.gypi
npm ERR! gyp verb extracted file from tarball node_headers/include/node/config.gypi
npm ERR! gyp verb extracted file from tarball node_headers/include/node/cppgc/common.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/js_native_api.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/js_native_api_types.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/libplatform/libplatform-export.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/libplatform/libplatform.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/libplatform/v8-tracing.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/node.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/node_api.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/node_api_types.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/node_buffer.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/node_object_wrap.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/node_version.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/aix.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/android-ifaddrs.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/bsd.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/darwin.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/errno.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/linux.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/os390.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/posix.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/stdint-msvc2008.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/sunos.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/threadpool.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/tree.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/unix.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/version.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv/win.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/uv.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-array-buffer.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-callbacks.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-container.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-context.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-cppgc.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-data.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-date.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-debug.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-embedder-heap.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-embedder-state-scope.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-exception.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-extension.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-external.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-fast-api-calls.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-forward.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-function-callback.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-function.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-initialization.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-inspector-protocol.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-inspector.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-internal.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-isolate.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-json.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-local-handle.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-locker.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-maybe.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-memory-span.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-message.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-metrics.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-microtask-queue.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-microtask.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-object.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-persistent-handle.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-platform.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-primitive-object.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-primitive.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-profiler.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-promise.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-proxy.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-regexp.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-script.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-snapshot.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-statistics.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-template.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-traced-handle.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-typed-array.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-unwinder-state.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-unwinder.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-util.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-value-serializer-version.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-value-serializer.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-value.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-version-string.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-version.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-wasm-trap-handler-posix.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-wasm-trap-handler-win.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-wasm.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8-weak-callback-info.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/v8config.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/zconf.h
npm ERR! gyp verb extracted file from tarball node_headers/include/node/zlib.h
npm ERR! gyp verb content checksum node-v23.1.1-headers.tar.gz 4b17074aff263b0fa16524a34146f19a0f8d7f65f3478ab525437836f13c07cb
npm ERR! gyp WARN install got an error, rolling back install
npm ERR! gyp verb command remove [ '23.1.1' ]
npm ERR! gyp verb remove using node-gyp dir: C:\Users\cloudtest\AppData\Local\node-gyp\Cache
npm ERR! gyp verb remove removing target version: 23.1.1
npm ERR! gyp verb remove removing development files for version: 23.1.1
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
npm ERR! gyp ERR! stack     at new NodeError (node:internal/errors:393:5)
npm ERR! gyp ERR! stack     at Unpack.<anonymous> (node:internal/streams/pipeline:352:14)
npm ERR! gyp ERR! stack     at Unpack.emit (node:events:525:35)
npm ERR! gyp ERR! stack     at [maybeClose] (D:\a\_work\_tool\node\18.12.1\x64\node_modules\npm\node_modules\tar\lib\unpack.js:228:12)
npm ERR! gyp ERR! stack     at Unpack.opt.ondone (D:\a\_work\_tool\node\18.12.1\x64\node_modules\npm\node_modules\tar\lib\unpack.js:129:23)
npm ERR! gyp ERR! stack     at Unpack.emit (node:events:525:35)
npm ERR! gyp ERR! stack     at [emit] (D:\a\_work\_tool\node\18.12.1\x64\node_modules\npm\node_modules\tar\lib\parse.js:285:12)
npm ERR! gyp ERR! stack     at [maybeEnd] (D:\a\_work\_tool\node\18.12.1\x64\node_modules\npm\node_modules\tar\lib\parse.js:401:17)
npm ERR! gyp ERR! stack     at [consumeChunk] (D:\a\_work\_tool\node\18.12.1\x64\node_modules\npm\node_modules\tar\lib\parse.js:432:21)
npm ERR! gyp ERR! stack     at Unzip.<anonymous> (D:\a\_work\_tool\node\18.12.1\x64\node_modules\npm\node_modules\tar\lib\parse.js:351:29)
npm ERR! gyp ERR! System Windows_NT 10.0.17763
npm ERR! gyp ERR! command "D:\\a\\_work\\_tool\\node\\18.12.1\\x64\\node.exe" "D:\\a\\_work\\_tool\\node\\18.12.1\\x64\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\a\_work\1\s\src\node_modules\clipboard-files
npm ERR! gyp ERR! node -v v18.12.1
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok
npm verb exit 1
@MRayermannMSFT
Copy link
Author

MRayermannMSFT commented Feb 27, 2023

Hmmmm I think this is related to isaacs/node-tar#321, but that should have been fixed in tar v6.1.12. I wonder if our machines are caching some older version somewhere? Maybe it would be good for node-gyp to bump tar to 6.1.12 to make sure that version is used.

@MRayermannMSFT
Copy link
Author

I have decided to workaround this issue by moving to npm 9.5.0, which has tar 6.1.13. Since npm 9 is the way forward, I don't mind if this issue is closed as "won't fix".

@cclauss cclauss added the Windows label Mar 2, 2023
@KunalBurangi
Copy link

I have decided to workaround this issue by moving to npm 9.5.0, which has tar 6.1.13. Since npm 9 is the way forward, I don't mind if this issue is closed as "won't fix".

I am also getting the same error...
i didn't understand what is the workaround...
can you please tell it in detail ?

@MRayermannMSFT
Copy link
Author

I have decided to workaround this issue by moving to npm 9.5.0, which has tar 6.1.13. Since npm 9 is the way forward, I don't mind if this issue is closed as "won't fix".

I am also getting the same error... i didn't understand what is the workaround... can you please tell it in detail ?

The workaround is to install a version of npm that has node-gyp using tar 6.1.12 or newer. I chose to use npm version 9.5.0 but there may be other versions that would work. To install a different version of npm you can simply do:

npm install --global npm@9.5.0

@KunalBurangi
Copy link

KunalBurangi commented Mar 2, 2023

ok it is still not working for me..
whats happening is I am trying to use sap nwrfcsdk SDK in node js
I have written a simple cpp program just to see I am able to use the functions from the SDK
this is the cpp file

#include <node.h>
#include <sapnwrfc.h>
namespace demo
{

    using v8::FunctionCallbackInfo;
    using v8::Isolate;
    using v8::Local;
    using v8::Object;
    using v8::String;
    using v8::Value;

    void Method(const FunctionCallbackInfo<Value> &args)
    {
        Isolate *isolate = args.GetIsolate();
        args.GetReturnValue().Set(String::NewFromUtf8(
                                      isolate, "I am kunal")
                                      .ToLocalChecked());
    }
    void Method2(const FunctionCallbackInfo<Value> &repoHandle)
    {
        RFC_RC rc;
        RFC_FUNCTION_DESC_HANDLE stfcDeepTableDesc;
        RFC_CONNECTION_PARAMETER repoCon[8], serverCon[3];
        RFC_CONNECTION_HANDLE repoHandle, serverHandle;
        RFC_ERROR_INFO errorInfo;

        serverCon[0].name = cU("program_id");
        serverCon[0].value = cU("MY_SERVER");
        serverCon[1].name = cU("gwhost");
        serverCon[1].value = cU("hostname");
        serverCon[2].name = cU("gwserv");
        serverCon[2].value = cU("sapgw53");

        repoCon[0].name = cU("client");
        repoCon[0].value = cU("000");
        repoCon[1].name = cU("user");
        repoCon[1].value = cU("user");
        repoCon[2].name = cU("passwd");
        repoCon[2].value = cU("****");
        repoCon[3].name = cU("lang");
        repoCon[3].value = cU("DE");
        repoCon[4].name = cU("ashost");
        repoCon[4].value = cU("hostname");
        repoCon[5].name = cU("sysnr");
        repoCon[5].value = cU("53");

        printfU(cU("Logging in..."));
        repoHandle.GetReturnValue().Set(RfcOpenConnection(repoCon, 6, &errorInfo));
        // if (repoHandle == NULL)
        //     errorHandling(errorInfo.code, cU("Error in RfcOpenConnection()"), &errorInfo, NULL);
        // printfU(cU(" ...done\n"));
    }

    void errorHandling(RFC_RC rc, SAP_UC *description, RFC_ERROR_INFO *errorInfo, RFC_CONNECTION_HANDLE connection)
    {
        printfU(cU("%s: %d\n"), description, rc);
        printfU(cU("%s: %s\n"), errorInfo->key, errorInfo->message);
        // It's better to close the TCP/IP connection cleanly, than to just let the
        // backend get a "Connection reset by peer" error...
        if (connection != NULL)
            RfcCloseConnection(connection, errorInfo);

        exit(1);
    }

    void Initialize(Local<Object> exports)
    {
        NODE_SET_METHOD(exports, "rfc", Method2);
    }

    NODE_MODULE(NODE_GYP_MODULE_NAME, Initialize)

}

this is the gyp file

{
  "targets": [
    {
      "target_name": "native",
      "sources": [
        "binding.cpp",
      ],
      "include_dirs": [
        "<!@(node -p \"require('node-addon-api').include\")"
      ],
      "dependencies": [
        "<!(node -p \"require('node-addon-api').gyp\")"
      ],
      "libraries":["C:\\nwrfcsdk\\lib"],
      
      "cflags!": ["-fno-exceptions"],
      "cflags_cc!": ["-fno-exceptions"],
      "defines": ["NAPI_CPP_EXCEPTIONS"]
    }
  ]
}`
the error I am getting is
![image](https://user-images.githubusercontent.com/37167732/222504235-04eec042-c589-4638-866b-671beb39622b.png)

can you please help.. 
@MRayermannMSFT 

@MRayermannMSFT
Copy link
Author

can you please help..

Sorry, I don't have the knowledge or time to help with your specific issue. 😔

@KunalBurangi
Copy link

oh , ok Thanks :)

@prodkt
Copy link

prodkt commented Mar 5, 2023

Still not working here. Same issue.

@cclauss cclauss assigned cclauss and unassigned cclauss Mar 5, 2023
@cclauss
Copy link
Contributor

cclauss commented Mar 5, 2023

@joaocgreis Any thoughts?

@MRayermannMSFT
Copy link
Author

Still not working here. Same issue.

@prodkt can you be specific on in what way things aren't working for you?

What do you get when you run npm -v?

@sher-karim05
Copy link

I am getting this error while installing pakages. node version is 18. kindly ha

npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility  
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm ERR! code 1
npm ERR! path E:\GaiComo\Arketipo\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe E:\GaiComo\Arketipo\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm ERR! gyp verb cli   'E:\\GaiComo\\Arketipo\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'rebuild',
npm ERR! gyp verb cli   '--verbose',
npm ERR! gyp verb cli   '--libsass_ext=',
npm ERR! gyp verb cli   '--libsass_cflags=',
npm ERR! gyp verb cli   '--libsass_ldflags=',
npm ERR! gyp verb cli   '--libsass_library='
npm ERR! gyp verb cli ]
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@18.14.0 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python Python is not set from command line or npm configuration
npm ERR! gyp verb find Python Python is not set from environment variable PYTHON
npm ERR! gyp verb find Python checking if "python3" can be used
npm ERR! gyp verb find Python - executing "python3" to get executable path
npm ERR! gyp verb find Python - "python3" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if "python" can be used
npm ERR! gyp verb find Python - executing "python" to get executable path
npm ERR! gyp verb find Python - "python" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if "python2" can be used
npm ERR! gyp verb find Python - executing "python2" to get executable path
npm ERR! gyp verb find Python - "python2" is not in PATH or produced an error
npm ERR! gyp verb find Python checking if Python is C:\Python37\python.exe
npm ERR! gyp verb find Python - executing "C:\Python37\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Python37\python.exe" could not be run
npm ERR! gyp verb find Python checking if Python is C:\Python27\python.exe
npm ERR! gyp verb find Python - executing "C:\Python27\python.exe" to get version
npm ERR! gyp verb find Python - "C:\Python27\python.exe" could not be run
npm ERR! gyp verb find Python checking if the py launcher can be used to find Python
npm ERR! gyp verb find Python - executing "py.exe" to get Python executable path
npm ERR! gyp verb find Python - "py.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python Python is not set from command line or npm configuration
npm ERR! gyp ERR! find Python Python is not set from environment variable PYTHON
npm ERR! gyp ERR! find Python checking if "python3" can be used
npm ERR! gyp ERR! find Python - "python3" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python" can be used
npm ERR! gyp ERR! find Python - "python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if "python2" can be used
npm ERR! gyp ERR! find Python - "python2" is not in PATH or produced an error
npm ERR! gyp ERR! find Python checking if Python is C:\Python37\python.exe
npm ERR! gyp ERR! find Python - "C:\Python37\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if Python is C:\Python27\python.exe
npm ERR! gyp ERR! find Python - "C:\Python27\python.exe" could not be run
npm ERR! gyp ERR! find Python checking if the py launcher can be used to find Python
npm ERR! gyp ERR! find Python - "py.exe" is not in PATH or produced an error
npm ERR! gyp ERR! find Python
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (E:\GaiComo\Arketipo\node_modules\node-gyp\lib\find-python.js:302:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (E:\GaiComo\Arketipo\node_modules\node-gyp\lib\find-python.js:136:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (E:\GaiComo\Arketipo\node_modules\node-gyp\lib\find-python.js:200:18)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (E:\GaiComo\Arketipo\node_modules\node-gyp\lib\find-python.js:266:16)        
npm ERR! gyp ERR! stack     at exithandler (node:child_process:427:5)
npm ERR! gyp ERR! stack     at ChildProcess.errorhandler (node:child_process:439:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:289:12)
npm ERR! gyp ERR! stack     at onErrorNT (node:internal/child_process:476:16)
npm ERR! gyp ERR! stack     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19045
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\GaiComo\\Arketipo\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd E:\GaiComo\Arketipo\node_modules\node-sass
npm ERR! gyp ERR! node -v v18.14.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\CL\AppData\Local\npm-cache\_logs\2023-03-07T15_55_10_406Z-debug-0.log

@cclauss
Copy link
Contributor

cclauss commented Mar 7, 2023

npm ERR! gyp info using node-gyp@7.1.2

Please upgrade… https://github.com/nodejs/node-gyp/releases

@sher-karim05
Copy link

@cclauss thanks for your response i will try.

@sher-karim05
Copy link

@cclauss its giving node-sass error.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@6.0.1 install: node scripts/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@6.0.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\CL\AppData\Roaming\npm-cache_logs\2023-03-07T17_27_08_482Z-debug.log
PS E:\GaiComo\Arketipo>

@cclauss
Copy link
Contributor

cclauss commented Mar 7, 2023

@sher-karim05
Copy link

@cclauss thanks

@cclauss cclauss closed this as completed Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants