Winnus not building on Windows 10

Posted on
  • Hi Everyone,
    I am trying to get the EspruinoCLI to work, but dependency Winnus (https://github.com/espruino/winnus) is not building on Windows10.

    I am getting a bunch of c++ errors:

    npm install
    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/issue­s/3142
    
    > winnus@0.0.6 install
    > node-gyp rebuild
    
    gyp info it worked if it ends with ok
    gyp info using node-gyp@7.1.2
    gyp info using node@16.4.0 | win32 | x64
    gyp info find Python using Python version 3.9.6 found at "C:\Python39\python.exe"
    gyp info find VS using VS2019 (16.10.31410.357) found at:
    gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
    gyp info find VS run with --verbose for detailed information
    (node:12068) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
    (Use `node --trace-deprecation ...` to show where the warning was created)
    gyp info spawn C:\Python39\python.exe
    gyp info spawn args [
    gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_m­odules\\node-gyp\\gyp\\gyp_main.py',
    gyp info spawn args   'binding.gyp',
    gyp info spawn args   '-f',
    gyp info spawn args   'msvs',
    gyp info spawn args   '-I',
    gyp info spawn args   'C:\\Projekte\\banglejs\\winnus\\build\\­config.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   'C:\\Program Files\\nodejs\\node_modules\\npm\\node_m­odules\\node-gyp\\addon.gypi',
    gyp info spawn args   '-I',
    gyp info spawn args   'C:\\Users\\Arbeit\\AppData\\Local\\node­-gyp\\Cache\\16.4.0\\include\\node\\comm­on.gypi',
    gyp info spawn args   '-Dlibrary=shared_library',
    gyp info spawn args   '-Dvisibility=default',
    gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Arbeit\\AppD­ata\\Local\\node-gyp\\Cache\\16.4.0',
    gyp info spawn args   '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_m­odules\\node-gyp',
    gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\Arbeit\\­\\AppData\\\\Local\\\\node-gyp\\\\Cache\­\\\16.4.0\\\\<(target_arch)\\\\node.lib'­,
    gyp info spawn args   '-Dmodule_root_dir=C:\\Projekte\\banglej­s\\winnus',
    gyp info spawn args   '-Dnode_engine=v8',
    gyp info spawn args   '--depth=.',
    gyp info spawn args   '--no-parallel',
    gyp info spawn args   '--generator-output',
    gyp info spawn args   'C:\\Projekte\\banglejs\\winnus\\build',­
    gyp info spawn args   '-Goutput_dir=.'
    gyp info spawn args ]
    gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\B­in\MSBuild.exe
    gyp info spawn args [
    gyp info spawn args   'build/binding.sln',
    gyp info spawn args   '/clp:Verbosity=minimal',
    gyp info spawn args   '/nologo',
    gyp info spawn args   '/p:Configuration=Release;Platform=x64'
    gyp info spawn args ]
    Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "-m" hinzufügen.
      winnus.cpp
    C:\Projekte\banglejs\winnus\cpp\winnus.c­pp(107,3): error C2664: "v8::Local<v8::Value> v8::Exception::Error(v8::Local<v8::Strin­g>)" : Konvertierung von Argument 1 von "v8::
    MaybeLocal<v8::String>" in "v8::Local<v8::String>" nicht möglich [C:\Projekte\banglejs\winnus\build\winnu­s.vcxproj]
    C:\Projekte\banglejs\winnus\cpp\winnus.c­pp(107,3): message : Kein benutzerdefinierter Konvertierungsoperator verfügbar, der diese Konvertierung durchführen kann, oder der
    Operator kann nicht aufgerufen werden [C:\Projekte\banglejs\winnus\build\winnu­s.vcxproj]
    C:\Users\Arbeit\AppData\Local\node-gyp\C­ache\16.4.0\include\node\v8.h(7469,23): message : Siehe Deklaration von "v8::Exception::Error" [C:\Projekte\banglejs\winnus\build\w
    innus.vcxproj]
    C:\Projekte\banglejs\winnus\cpp\winnus.c­pp(134,113): error C2661: "v8::Object::Set": Keine überladene Funktion akzeptiert 2 Argumente [C:\Projekte\banglejs\winnus\build\wi
    nnus.vcxproj]
    C:\Projekte\banglejs\winnus\cpp\winnus.c­pp(138,116): error C2661: "v8::Object::Set": Keine überladene Funktion akzeptiert 2 Argumente [C:\Projekte\banglejs\winnus\build\wi
    nnus.vcxproj]
    C:\Projekte\banglejs\winnus\cpp\winnus.c­pp(139,38): error C2661: "v8::Object::Set": Keine überladene Funktion akzeptiert 2 Argumente [C:\Projekte\banglejs\winnus\build\win
    nus.vcxproj]
    C:\Projekte\banglejs\winnus\cpp\winnus.c­pp(160,40): error C2664: "v8::Local<v8::Value> v8::Exception::Error(v8::Local<v8::Strin­g>)" : Konvertierung von Argument 1 von "v8:
    :MaybeLocal<v8::String>" in "v8::Local<v8::String>" nicht möglich [C:\Projekte\banglejs\winnus\build\winnu­s.vcxproj]
    C:\Projekte\banglejs\winnus\cpp\winnus.c­pp(161,28): message : Kein benutzerdefinierter Konvertierungsoperator verfügbar, der diese Konvertierung durchführen kann, oder der
     Operator kann nicht aufgerufen we
    
  • Hi - I think this is due to the Node.js version - every few releases they change the API and it breaks old native plugins.

    However you shouldn't actually need the library anyway. Are you trying to connect with Bluetooth or USB? Usually for those you use noble for BLE or serialport for USB

  • Okay, if i run the CLI with --verbose I get the following output:

    edit: I want to connect w/ bluetooth.

    node node_modules\espruino\bin\espruino-cli.j­s --verbose
    0.1.38
    Espruino Command-line Tool 0.1.38
    -----------------------------------
    
    Acorn library not found - you'll need it for compiled code
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/libs/targz.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/libs/utf8.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/espruino.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/codeWriter.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/config.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/env.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/flasher.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/flasherESP8266.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/modules.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/notifications.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/serial.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/serial_chrome_serial.js
    No chrome.serial - Chrome Serial disabled
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/serial_chrome_socket.js
    No chrome.sockets - Chrome Socket disabled
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/serial_frame.js
    serial_frame: Not running in a browser
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/serial_noble.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/serial_node_serial.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/serial_node_socket.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/serial_websocket_local.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/serial_websocket_relay.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/serial_web_audio.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/serial_web_bluetooth.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/serial_web_serial.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/serial_winnus.js
    'winnus' module not found, no Windows Bluetooth Low Energy Error: Cannot find module 'winnus'
    Require stack:
    - C:\Projekte\banglejs\test\node_modules\e­spruino\index.js
    - C:\Projekte\banglejs\test\node_modules\e­spruino\bin\espruino-cli.js
        at Function.Module._resolveFilename (node:internal/modules/cjs/loader:927:15­)
        at Function.Module._load (node:internal/modules/cjs/loader:772:27­)
        at Module.require (node:internal/modules/cjs/loader:999:19­)
        at require (node:internal/modules/cjs/helpers:93:18­)
        at eval (eval at loadJS (C:\Projekte\banglejs\test\node_modules\­espruino\index.js:12:11), <anonymous>:10:14)
        at eval (eval at loadJS (C:\Projekte\banglejs\test\node_modules\­espruino\index.js:12:11), <anonymous>:124:3)
        at loadJS (C:\Projekte\banglejs\test\node_modules\­espruino\index.js:12:11)
        at loadDir (C:\Projekte\banglejs\test\node_modules\­espruino\index.js:24:7)
        at Object.init (C:\Projekte\banglejs\test\node_modules\­espruino\index.js:97:3)
        at Object.<anonymous> (C:\Projekte\banglejs\test\node_modules\­espruino\bin\espruino-cli.js:844:24) {
      code: 'MODULE_NOT_FOUND',
      requireStack: [
        'C:\\Projekte\\banglejs\\test\\node_modu­les\\espruino\\index.js',
        'C:\\Projekte\\banglejs\\test\\node_modu­les\\espruino\\bin\\espruino-cli.js'
      ]
    }
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/terminal.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/core/utils.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/plugins/assembler.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/plugins/boardJSON.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/plugins/compiler.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/plugins/getGitHub.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/plugins/localModules.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/plugins/minify.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/plugins/pretokenise.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/plugins/saveOnSend.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/plugins/setTime.js
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/plugins/unicode.js
    UTF8 Library loaded successfully
    Found C:\Projekte\banglejs\test\node_modules\e­spruino/plugins/versionChecker.js
    Initialising CodeWriter
    Initialising Config
    Initialising Env
    Initialising Flasher
    Initialising FlasherESP8266
    Initialising Modules
    Initialising Notifications
    Initialising Serial
      - Initialising Serial Noble Bluetooth LE
      - Initialising Serial Node Serial
      - Initialising Serial Node Socket
      - Initialising Serial Web Audio
      - Initialising Serial Web Bluetooth
      - Initialising Serial Web Serial
    Initialising Utils
    Initialising Status
    Initialising Assembler
    Initialising BoardJSON
    Initialising Compiler
    Initialising GetGitHub
    Initialising LocalModules
    Initialising Minify
    Initialising Pretokenise
    Initialising SaveOnSend
    Initialising SetTime
    Initialising Unicode
    Initialising VersionChecker
    Initialising CoreModules
    Searching for serial ports...
    Noble: getPorts - initialising...
    undefined:55
        } else throw err;
               ^
    
    Error: LIBUSB_ERROR_NOT_SUPPORTED
        at Device.usb.Device.open (C:\Projekte\banglejs\test\node_modules\­usb\usb.js:38:7)
        at BluetoothHciSocket.bindUser (C:\Projekte\banglejs\test\node_modules\­@abandonware\bluetooth-hci-socket\lib\us­b.js:94:19)
        at BluetoothHciSocket.bindRaw (C:\Projekte\banglejs\test\node_modules\­@abandonware\bluetooth-hci-socket\lib\us­b.js:47:8)
        at Hci.init (C:\Projekte\banglejs\test\node_modules\­@abandonware\noble\lib\hci-socket\hci.js­:120:18)
        at NobleBindings.init (C:\Projekte\banglejs\test\node_modules\­@abandonware\noble\lib\hci-socket\bindin­gs.js:93:13)
        at C:\Projekte\banglejs\test\node_modules\@­abandonware\noble\lib\noble.js:61:24
        at processTicksAndRejections (node:internal/process/task_queues:78:11­) {
      errno: -12
    }
    
  • edit: Ahh, just spotted you said bluetooth!

  • Ok, so the issue is most likely that Noble isn't picking up your Bluetooth adaptor.

    'Noble' has this video linked showing you what you need to do to set it up: https://www.youtube.com/watch?v=mL9B8wuE­dms&t=106s

    It's often a lot more sensible to add an external Bluetooth dongle which Noble can then pick up and use (rather than trying to use Zadig on your internal adaptor, which then stops normal Windows from using it)

    Unfortunately Bluetooth LE with Node.js on Windows is a mess right now. It's one of the reasons I push everyone to the Web IDE - because it 'just works'.

  • I should add that there is this library: https://github.com/jasongin/noble-uwp

    Which should be able to replace noble and 'just work' on Windows. You would have to install it and then change 'serial-noble.js` to make it work though.

  • Okay, Zadig did the trick.
    TY

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Winnus not building on Windows 10

Posted by Avatar for sauerman @sauerman

Actions