Skip to content

node-bluetooth causing build error #40

Open

Description

@James-Machouk

Environments :

  • Windows 10 version 1903
  • Visual Studio Enterprise 2019
  • Python 2.7
  • node v12.9.1
  • node-gyp v5.0.3

The problem
I was trying to use ESCPOS_2.5.2 when node-gyp start building the ( node-bluetooth ) module, warnings and errors start to pop on the console till

gyp ERR! build error
gyp ERR! stack Error: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Current\Bin\MSBuild.exe" failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Users\xxxx\AppData\Roaming\npm\node_modules\node-gyp\lib\build.js:196:23)
gyp ERR! stack at ChildProcess.emit (events.js:209:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\xxxx\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "build"
gyp ERR! cwd D:_Node_field\pos_printer\node_modules\node-bluetooth
gyp ERR! node -v v12.9.1
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
npm WARN pos_printer@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-bluetooth@1.2.6 (node_modules\node-bluetooth):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: node-bluetooth@1.2.6 install: node-gyp configure build
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status

is something with the environment causing the problem?

Activity

  1. changed the title [-]node-bluetooth caussing build error[/-] [+]node-bluetooth causing build error[/+] on Sep 4, 2019
  2. netrevisanto commented on Sep 25, 2019

    @netrevisanto

    Same problem, please, any advice?

  3. peterpoliwoda commented on Oct 16, 2019

    @peterpoliwoda

    In my case there was a quick hack to get it to install xpc-connection, not sure if it's related to your problem, but the current version of xpc does not work with anything over node 8+. See if this helps: npm install git://github.com/taoyuan/node-xpc-connection.git

  4. webkong commented on Oct 23, 2019

    @webkong

    I think I hava the same problem. pls any repair.

  5. grosseruser commented on Oct 30, 2019

    @grosseruser

    ...same Problem. After 3 days testing & RTFM.

    Environments :
    Fresh new Windows 10 version 1903 installation
    Visual Studio Community 2019 / Bulid tools 2017 & 2015 (npm install --global windows-build-tools)
    Python 2.7.17
    node v12.13.0
    node-gyp v5.0.3

    "npm install node-bluetooth --save --verbose"

    ...
    "C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\build\binding.sln" (Standardziel) (1) ->

    "C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj" (Standardziel) (2) ->
    (ClCompile Ziel) ->
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(128,72): error C2660: "v8::FunctionTemplate::GetFunction": Funktion akzeptiert keine 0 ArgumenteC:\Users\gross
    AppData\Local\node-gyp\Cache\12.13.0\include\node\v8.h(3457): note: Siehe Deklaration von "v8::Object::Get" [C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcx
    proj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(128,73): error C2661: "v8::Object::Set": Keine überladene Funktion akzeptiert 1 ArgumenteC:\Users\gross\Documen
    ts\electron\lotse\node_modules\node-bluetooth\src\windows\BTSerialPortBinding.cc(196,1): warning C4996: 'Nan::Callback::Call': wurde als veraltet deklariert [C:\Users\gross\Documents\electron\lotse\node_mod
    ules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(129,72): error C2660: "v8::FunctionTemplate::GetFunction": Funktion akzeptiert keine 0 Argumente [C:\Users\gros
    s\Documents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(129,73): error C2661: "v8::Object::Set": Keine überladene Funktion akzeptiert 1 Argumente [C:\Users\gross\Docum
    ents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\BTSerialPortBinding.cc(219,82): error C2660: "v8::FunctionTemplate::GetFunction": Funktion akzeptiert keine 0 Argumente [C:
    Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(130,72): error C2660: "v8::FunctionTemplate::GetFunction": Funktion akzeptiert keine 0 Argumente [C:\Users\gros
    s\Documents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\BTSerialPortBinding.cc(219,83): error C2661: "v8::Object::Set": Keine überladene Funktion akzeptiert 1 Argumente [C:\Users\g
    ross\Documents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(130,73): error C2661: "v8::Object::Set": Keine überladene Funktion akzeptiert 1 Argumente [C:\Users\gross\Docum
    ents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\BTSerialPortBinding.cc(220,82): error C2660: "v8::FunctionTemplate::GetFunction": Funktion akzeptiert keine 0 Argumente [C:
    Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(131,72): error C2660: "v8::FunctionTemplate::GetFunction": Funktion akzeptiert keine 0 Argumente [C:\Users\gros
    s\Documents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\BTSerialPortBinding.cc(220,83): error C2661: "v8::Object::Set": Keine überladene Funktion akzeptiert 1 Argumente [C:\Users\g
    ross\Documents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(131,73): error C2661: "v8::Object::Set": Keine überladene Funktion akzeptiert 1 Argumente [C:\Users\gross\Docum
    ents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\BTSerialPortBinding.cc(221,82): error C2660: "v8::FunctionTemplate::GetFunction": Funktion akzeptiert keine 0 Argumente [C:
    Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\BTSerialPortBinding.cc(242,39): error C2664: "v8::String::Utf8Value::Utf8Value(const v8::String::Utf8Value &)" : Konvertieru
    ng von Argument 1 von "v8::Localv8::Value" in "const v8::String::Utf8Value &" nicht möglich [C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\BTSerialPortBinding.cc(243,41): error C2660: "v8::Value::Int32Value": Funktion akzeptiert keine 0 Argumente [C:\Users\gross
    Documents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(336,39): error C2664: "v8::String::Utf8Value::Utf8Value(const v8::String::Utf8Value &)" : Konvertierung von Arg
    ument 1 von "v8::Localv8::Value" in "const v8::String::Utf8Value &" nicht möglich [C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]
    C:\Users\gross\Documents\electron\lotse\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(522,57): error C2660: "v8::Function::Call": Funktion akzeptiert keine 3 Argumente [C:\Users\gross\Documents\ele
    ctron\lotse\node_modules\node-bluetooth\build\BluetoothSerialPort.vcxproj]

    49 Warnung(en)
    17 Fehler
    ...

  6. James-Machouk commented on Oct 30, 2019

    @James-Machouk
    Author

    Potential Solution:

    this is what i did to make it work

    initalize NPM : npm init
    Install Electron as dev dependencies : npm i -D electron@latest
    Set this NPM Config :

    • set npm_config_target=6.0.7 <- Version of electron installed
    • set npm_config_arch=x64
    • set npm_config_runtime=electron
    • set npm_config_build_from_source=true
    • set PYTHON=C:\Users\[YourUser]\.windows-build-tools\python27\python.exe
    • set npm_config_node_gyp=C:\Users\[YourUser]\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js

    Install the escpos package : npm install escpos --save
    Rebuild electron : npm install --save-dev electron-rebuild

    please be sure of the path of python & node-gyp ( it may vary on your system )

  7. grosseruser commented on Nov 3, 2019

    @grosseruser

    ...after 6 days testing I have now a working configuration for escpos.
    node v11.15.0
    electron v5.0.11
    electron-rebuild 1.8.5
    escpos 2.5.2

    Windows build tools: npm install --global --production windows-build-tools
    Python 2.7.17

  8. tazougphi commented on Nov 19, 2019

    @tazougphi

    There might be more going on here, but I had a similar compilation issue and downgrading to Visual Studio 2017 fixed it

    edit: I also had to downgrade to NodeJS 11

  9. James-Machouk commented on Nov 19, 2019

    @James-Machouk
    Author

    There might be more going on here, but I had a similar compilation issue and downgrading to Visual Studio 2017 fixed it

    edit: I also had to downgrade to NodeJS 11

    If you want for any reason to use the latest version of VS Studio and node you can check this solution #40 (comment)

  10. karthikjn01 commented on May 18, 2024

    @karthikjn01

    I'm also running into this issue now, I think it might be a good idea to update the node-bluetooth package version to be compatible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions