Attempting to Install Serial Port Node on Windows 10 fails

Hello,

I am attempting to install node-red-node-serialport 0.14.0 on a fully up to date Windows 10 (64-bit) professional PC. I installed Node-Red yesterday and it is running fine. However the serial port installation fails. I have looked at the log but I admit to not understanding it. As a new user I can't upload the file so have added it here. Sorry .

If possible could someone point me in the right direction or let me know if this just doesn't run on windows.

Many Thanks.

2021-05-06T08:57:56.648Z Install : node-red-node-serialport 0.14.0

2021-05-06T08:57:56.968Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-node-serialport@0.14.0
2021-05-06T08:58:02.363Z [err] npm
2021-05-06T08:58:02.363Z [err] ERR! code 1
2021-05-06T08:58:02.363Z [err] npm ERR! path C:\Users\Dirk.node-red\node_modules@serialport\bindings
2021-05-06T08:58:02.366Z [err] npm
2021-05-06T08:58:02.366Z [err] ERR! command failed
2021-05-06T08:58:02.366Z [err] npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
2021-05-06T08:58:02.366Z [err] npm ERR! prebuild-install WARN install No prebuilt binaries found (target=16.1.0 runtime=node arch=x64 libc= platform=win32)
2021-05-06T08:58:02.366Z [err] npm ERR!
2021-05-06T08:58:02.366Z [err] gyp info it worked if it ends with ok
2021-05-06T08:58:02.366Z [err] npm ERR! gyp info using node-gyp@7.1.2
2021-05-06T08:58:02.366Z [err] npm ERR! gyp info using node@16.1.0 | win32 | x64
2021-05-06T08:58:02.366Z [err] npm
2021-05-06T08:58:02.366Z [err] ERR! gyp info find Python using Python version 3.7.9 found at "C:\Users\Dirk\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe"
2021-05-06T08:58:02.366Z [err] npm ERR!
2021-05-06T08:58:02.366Z [err] gyp info find VS using VS2019 (16.9.31205.134) found at:
2021-05-06T08:58:02.366Z [err] npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
2021-05-06T08:58:02.366Z [err] npm
2021-05-06T08:58:02.366Z [err] ERR! gyp info find VS run with --verbose for detailed information
2021-05-06T08:58:02.366Z [err] npm ERR!
2021-05-06T08:58:02.366Z [err] (node:17856) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
2021-05-06T08:58:02.366Z [err] npm ERR! (Use node --trace-deprecation ... to show where the warning was created)
2021-05-06T08:58:02.366Z [err] npm ERR! gyp info spawn C:\Users\Dirk\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.7_qbz5n2kfra8p0\python.exe
2021-05-06T08:58:02.366Z [err] npm
2021-05-06T08:58:02.366Z [err] ERR! gyp info spawn args [
2021-05-06T08:58:02.366Z [err] npm
2021-05-06T08:58:02.366Z [err] ERR! gyp info spawn args 'C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py',
2021-05-06T08:58:02.366Z [err] npm
2021-05-06T08:58:02.366Z [err] ERR! gyp info spawn args 'binding.gyp',
2021-05-06T08:58:02.366Z [err] npm
2021-05-06T08:58:02.366Z [err] ERR! gyp info spawn args '-f',
2021-05-06T08:58:02.366Z [err] npm ERR!
2021-05-06T08:58:02.366Z [err] gyp info spawn args 'msvs',
2021-05-06T08:58:02.366Z [err] npm ERR!
2021-05-06T08:58:02.366Z [err] gyp info spawn args '-I',
2021-05-06T08:58:02.366Z [err] npm ERR!
2021-05-06T08:58:02.366Z [err] gyp info spawn args 'C:\Users\Dirk\.node-red\node_modules\@serialport\bindings\build\config.gypi',
2021-05-06T08:58:02.366Z [err] npm ERR!
2021-05-06T08:58:02.367Z [err] gyp info spawn args '-I',
2021-05-06T08:58:02.367Z [err] npm ERR!
2021-05-06T08:58:02.367Z [err] gyp info spawn args 'C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\addon.gypi',
2021-05-06T08:58:02.367Z [err] npm ERR!
2021-05-06T08:58:02.367Z [err] gyp info spawn args '-I',
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.367Z [err] ERR! gyp info spawn args 'C:\Users\Dirk\AppData\Local\node-gyp\Cache\16.1.0\common.gypi',
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.367Z [err] ERR! gyp info spawn args '-Dlibrary=shared_library',
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.367Z [err] ERR! gyp info spawn args '-Dvisibility=default',
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.367Z [err] ERR! gyp info spawn args '-Dnode_root_dir=C:\Users\Dirk\AppData\Local\node-gyp\Cache\16.1.0',
2021-05-06T08:58:02.367Z [err] npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp',
2021-05-06T08:58:02.367Z [err] npm ERR!
2021-05-06T08:58:02.367Z [err] gyp info spawn args '-Dnode_lib_file=C:\\Users\\Dirk\\AppData\\Local\\node-gyp\\Cache\\16.1.0\\<(target_arch)\\node.lib',
2021-05-06T08:58:02.367Z [err] npm ERR!
2021-05-06T08:58:02.367Z [err] gyp info spawn args '-Dmodule_root_dir=C:\Users\Dirk\.node-red\node_modules\@serialport\bindings',
2021-05-06T08:58:02.367Z [err] npm ERR!
2021-05-06T08:58:02.367Z [err] gyp info spawn args '-Dnode_engine=v8',
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.367Z [err] ERR! gyp info spawn args '--depth=.',
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.367Z [err] ERR! gyp info spawn args '--no-parallel',
2021-05-06T08:58:02.367Z [err] npm ERR!
2021-05-06T08:58:02.367Z [err] gyp info spawn args '--generator-output',
2021-05-06T08:58:02.367Z [err] npm ERR!
2021-05-06T08:58:02.367Z [err] gyp info spawn args 'C:\Users\Dirk\.node-red\node_modules\@serialport\bindings\build',
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.367Z [err] ERR! gyp info spawn args '-Goutput_dir=.'
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.367Z [err] ERR! gyp info spawn args ]
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.367Z [err] ERR! gyp: C:\Users\Dirk\AppData\Local\node-gyp\Cache\16.1.0\common.gypi not found (cwd: C:\Users\Dirk.node-red\node_modules@serialport\bindings) while reading includes of binding.gyp while trying to load binding.gyp
2021-05-06T08:58:02.367Z [err] npm ERR! gyp ERR! configure error
2021-05-06T08:58:02.367Z [err] npm ERR!
2021-05-06T08:58:02.367Z [err] gyp ERR! stack Error: gyp failed with exit code: 1
2021-05-06T08:58:02.367Z [err] npm ERR!
2021-05-06T08:58:02.367Z [err] gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16)
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.367Z [err] ERR! gyp ERR! stack at ChildProcess.emit (node:events:365:28)
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.367Z [err] ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.367Z [err] ERR! gyp ERR! System Windows_NT 10.0.19042
2021-05-06T08:58:02.367Z [err] npm ERR!
2021-05-06T08:58:02.367Z [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"
2021-05-06T08:58:02.367Z [err] npm ERR!
2021-05-06T08:58:02.367Z [err] gyp ERR! cwd C:\Users\Dirk.node-red\node_modules@serialport\bindings
2021-05-06T08:58:02.367Z [err] npm ERR!
2021-05-06T08:58:02.367Z [err] gyp ERR! node -v v16.1.0
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.367Z [err] ERR! gyp ERR! node-gyp -v v7.1.2
2021-05-06T08:58:02.367Z [err] npm
2021-05-06T08:58:02.368Z [err] ERR! gyp ERR! not ok
2021-05-06T08:58:02.377Z [err]
2021-05-06T08:58:02.377Z [err] npm ERR! A complete log of this run can be found in:
2021-05-06T08:58:02.377Z [err] npm ERR! C:\Users\Dirk\AppData\Local\npm-cache_logs\2021-05-06T08_58_02_369Z-debug.log
2021-05-06T08:58:02.392Z rc=1

Have you installed the build tools for Windows as per this section of the Windows install guide? Running on Windows : Node-RED

Namely npm install --global --production windows-build-tools ?

Thanks for responding.

Well I have tried. However, it gives me two warnings and appears to hang. I have waited for 30 minutes and it just doesn't do anything. It is in powershell running as an administrator.

npm install --global --production windows-build-tools
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request@2.88.2: request has been deprecated, see Request’s Past, Present and Future · Issue #3142 · request/request · GitHub
[ ] / reify:resolve: timing re

Also, nodejs 16.x is not yet supported, you should remove that and install 12 or14, then re-install the windows tools and node-red. It is all detailed in the install guide for Windows.

Thank you. It all came down to the nodejs being version 16. I reinstalled this and also checked the box so that all the tools would install at once and then it all works.

Thanks for the help. I misread the windows installation page 'Download the latest 12.x LTS version'. I think my brain focused on the word 'Latest' and so that's what I did.

Once again, thanks for the prompt and pleasant help.

2 Likes

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.