Error installing the package

Using windows server 2012 R2 Std
Trying to run:
npm install ncd-red-wireless

and get a lot of error, not sure what did I do wrong?

1 Like

Try running npm update and then try installing the package. If that does now work let us know what version of node and npm are installed.

Thanks for the reply, issue is related to serial port binding:
npm ERR! code 1
npm ERR! path C:\Users\Administrator.node-red\node_modules\ncd-red-comm\node_modules@serialport\bindings
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c “prebuild-install --tag-prefix @serialport/bindings@ || node-gyp
ebuild”

Although when I ran serial port install (npm i node-red-node-serialport), it seemed to be installed fine,

These are the versions:

PS C:\Users\Administrator.node-red> npm --version
7.0.3
PS C:\Users\Administrator.node-red> node-red --version
30 Oct 12:53:59 - [info] Node-RED version: v1.2.2
30 Oct 12:53:59 - [info] Node.js version: v15.0.1
30 Oct 12:53:59 - [info] Windows_NT 6.3.9600 x64 LE
30 Oct 12:54:00 - [info] Loading palette nodes
30 Oct 12:54:01 - [info] Dashboard version 2.23.5 started at /ui
30 Oct 12:54:01 - [warn] ------------------------------------------------------
30 Oct 12:54:01 - [warn] [ncd-red-comm/ncd-comm] Error: Could not locate the bindings file. Tried:

I am getting an error during the installation of @serialport/bindings@2.0.8 as well. I am using node 14.15.4.

If anyone else hits this problem, I was able to solve it by removing node v14 and installing a previous version on the v12 line. At the time of writing, v12.20.1 was the latest on that line.

@duelingcats can you elaborate more on how you removed the version and how to install v12, I am facing the same issue.

Thanks in advance

1 Like

@TravisE_NCD_Technica

Bumping an old thread here, but the serialport npm dependency seems to be an ongoing issue. I was trying to do a fresh install of node-red with ncd-red-wireless in a virtual machine and keep running into issues. Last time I used an old version of nodejs that finally worked, but it is getting dated.

I created a fresh win 10 VM and only installed Visual Studio 2022, nodejs, and node-red. Nodejs is v16.20.0, npm 8.19.4.

When I run ‘npm install -g ncd-red-wirless’ this is the error output I am getting. Doing some quick searching it appears lots of people run into these bindings problem. Do you know of a good work around or can you replicate in a fresh VM and provide a fix?

npm ERR! code 1
npm ERR! path C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
npm ERR! Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
npm ERR!
npm ERR!   serialport.cpp
npm ERR! C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\src\serialport.cpp(329,12): error C2661: 'v8::Object::Set': no overloaded function takes 2 arguments [C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\build\bindings.vcxproj]
npm ERR! C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\src\serialport.cpp(329,12): message : while trying to match the argument list '(v8::Local<v8::String>, v8::Local<v8::Boolean>)' [C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\build\bindings.vcxproj]
npm ERR! C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\src\serialport.cpp(330,12): error C2661: 'v8::Object::Set': no overloaded function takes 2 arguments [C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\build\bindings.vcxproj]
npm ERR! C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\src\serialport.cpp(330,12): message : while trying to match the argument list '(v8::Local<v8::String>, v8::Local<v8::Boolean>)' [C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\build\bindings.vcxproj]
npm ERR! C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\src\serialport.cpp(331,12): error C2661: 'v8::Object::Set': no overloaded function takes 2 arguments [C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\build\bindings.vcxproj]
npm ERR! C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\src\serialport.cpp(331,12): message : while trying to match the argument list '(v8::Local<v8::String>, v8::Local<v8::Boolean>)' [C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\build\bindings.vcxproj]
npm ERR! C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\src\serialport.cpp(378,12): error C2661: 'v8::Object::Set': no overloaded function takes 2 arguments [C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\build\bindings.vcxproj]
npm ERR! C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\src\serialport.cpp(378,12): message : while trying to match the argument list '(v8::Local<v8::String>, v8::Local<v8::Integer>)' [C:\Users\myusername\AppData\Roaming\npm\node_modules\ncd-red-wireless\node_modules\@serialport\bindings\build\bindings.vcxproj]

Doing some more digging, it looks like ncd-red-wireless install depends on https://www.npmjs.com/package/@serialport/bindings/v/2.0.8 which is pretty old and I think is the reason for the failing.

Hi,

The ncd-red-wireless library is for embedded systems such as our Edge Computer that do not support the latest versions of nodejs and node-red.

For more robust devices we recommend this library: @ncd-io/node-red-enterprise-sensors - npm

Thanks, I will try that out. I didn’t even know it existed as the documentation here Wireless Sensors and Node-RED - Enterprise Ready doesn’t mention that library. I couldn’t find any mention of that library on the site.

I think you all having a wiki would be helpful to search for documentation easier. :+1:

Hi, I am having the same issue, tried installing the enterprise library but still getting an error on serial bindings.

npm ERR! code 1
npm ERR! path C:\Users\SHR-RATDUDE.node-red\node_modules@serialport\bindings
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
npm ERR! prebuild-install warn install No prebuilt binaries found (target=20.9.0 runtime=node arch=x64 libc= platform=win32)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.0
npm ERR! gyp info using node@20.9.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.12.0 found at “C:\Python312\python.exe”
npm ERR! gyp info find VS using VS2022 (17.7.34221.43) found at:
npm ERR! gyp info find VS “C:\Program Files\Microsoft Visual Studio\2022\Community”
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Python312\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args ‘C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py’,
npm ERR! gyp info spawn args ‘binding.gyp’,
npm ERR! gyp info spawn args ‘-f’,
npm ERR! gyp info spawn args ‘msvs’,
npm ERR! gyp info spawn args ‘-I’,
npm ERR! gyp info spawn args ‘C:\Users\SHR-RATDUDE\.node-red\node_modules\@serialport\bindings\build\config.gypi’,
npm ERR! gyp info spawn args ‘-I’,
npm ERR! gyp info spawn args ‘C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\addon.gypi’,
npm ERR! gyp info spawn args ‘-I’,
npm ERR! gyp info spawn args ‘C:\Users\SHR-RATDUDE\AppData\Local\node-gyp\Cache\20.9.0\include\node\common.gypi’,
npm ERR! gyp info spawn args ‘-Dlibrary=shared_library’,
npm ERR! gyp info spawn args ‘-Dvisibility=default’,
npm ERR! gyp info spawn args ‘-Dnode_root_dir=C:\Users\SHR-RATDUDE\AppData\Local\node-gyp\Cache\20.9.0’,
npm ERR! gyp info spawn args ‘-Dnode_gyp_dir=C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp’,
npm ERR! gyp info spawn args ‘-Dnode_lib_file=C:\\Users\\SHR-RATDUDE\\AppData\\Local\\node-gyp\\Cache\\20.9.0\\<(target_arch)\\node.lib’,
npm ERR! gyp info spawn args ‘-Dmodule_root_dir=C:\Users\SHR-RATDUDE\.node-red\node_modules\@serialport\bindings’,
npm ERR! gyp info spawn args ‘-Dnode_engine=v8’,
npm ERR! gyp info spawn args ‘–depth=.’,
npm ERR! gyp info spawn args ‘–no-parallel’,
npm ERR! gyp info spawn args ‘–generator-output’,
npm ERR! gyp info spawn args ‘C:\Users\SHR-RATDUDE\.node-red\node_modules\@serialport\bindings\build’,
npm ERR! gyp info spawn args ‘-Goutput_dir=.’
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR! File “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py”, line 42, in
npm ERR! import gyp # noqa: E402
npm ERR! ^^^^^^^^^^
npm ERR! File “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init_.py”, line 9, in
npm ERR! import gyp.input
npm ERR! File “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py”, line 19, in
npm ERR! from distutils.version import StrictVersion
npm ERR! ModuleNotFoundError: No module named ‘distutils’
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: gyp failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:325:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:514:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuild”
npm ERR! gyp ERR! cwd C:\Users\SHR-RATDUDE.node-red\node_modules@serialport\bindings
npm ERR! gyp ERR! node -v v20.9.0
npm ERR! gyp ERR! node-gyp -v v9.4.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: C:\Users\SHR-RATDUDE\AppData\Local\npm-cache_logs\2023-11-03T16_49_16_401Z-debug-0.log

Hi mrat,

You will need the windows build tools in order to compile the serial port library. Make sure to use the commands outlined under the section “Installing Node.js Windows Build Tools” on this page: Running on Windows : Node-RED.

Additionally Python v3.12 has reportedly created an issue with the node-gyp compiler, you’ll need to roll back python to a previous version. v3.10 has been tested to work.

Did you happen to install nodejs using administrator rights? This can cause some issues if it installs it such that only administrators can run it or setup the cache files npm uses.