# Error installing node-red-node-arduino on Windows 10

**URL:** <https://discourse.nodered.org/t/error-installing-node-red-node-arduino-on-windows-10/51722>\
**Category:** General\
**Created:** [30 September 2021 15:25 UTC](https://discourse.nodered.org/t/error-installing-node-red-node-arduino-on-windows-10/51722 "2021-09-30T15:25:56Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gyan](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gyan](https://discourse.nodered.org/u/gyan)\
**Post date:** [30 September 2021 15:25 UTC](https://discourse.nodered.org/t/error-installing-node-red-node-arduino-on-windows-10/51722/1 "2021-09-30T15:25:56Z")

</div>

I was trying to follow the instruction at [Interacting with Arduino : Node-RED](https://nodered.org/docs/faq/interacting-with-arduino) to interface arduino with node-red. Until now, I've installed node-red, and loaded the firmata firmware on the board.  
When I'm trying to install `node-red-node-arduino` using `npm install node-red-node-arduino` in the `.node-red` directory, I get build errors.

Node-red and NPM version:

```auto
30 Sep 20:49:43 - [info] Node-RED version: v2.0.6
30 Sep 20:49:43 - [info] Node.js version: v12.14.0
30 Sep 20:49:43 - [info] Windows_NT 10.0.19043 x64 LE

```

The error message is:

```auto
npm ERR! code 1
npm ERR! path C:\Users\kumar\.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! Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
npm ERR! serialport.cpp
npm ERR! serialport_win.cpp
npm ERR! win_delay_load_hook.cc
npm ERR! C:\\Users\\kumar\\AppData\\Local\\node-gyp\\Cache\\12.14.0\\x64\\node.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0x4B662D [C:\Users\kumar\.node-red\node_modules\@serialport\bindings\build\bindings.vcxproj]
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@12.14.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.7 found at "C:\Users\kumar\AppData\Local\Programs\Python\Python39-64\python.exe"
npm ERR! gyp info find VS using VS2019 (16.10.31410.357) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\kumar\AppData\Local\Programs\Python\Python39-64\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\Users\\kumar\\AppData\\Roaming\\npm\\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\\kumar\\.node-red\\node_modules\\@serialport\\bindings\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\kumar\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\kumar\\AppData\\Local\\node-gyp\\Cache\\12.14.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\\kumar\\AppData\\Local\\node-gyp\\Cache\\12.14.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\kumar\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\kumar\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\12.14.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\Users\\kumar\\.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\\kumar\\.node-red\\node_modules\\@serialport\\bindings\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build/binding.sln',
npm ERR! gyp info spawn args '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args '/nologo',
npm ERR! gyp info spawn args '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onExit (C:\Users\kumar\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:210:5)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "D:\\software installation\\nodejs\\node.exe" "C:\\Users\\kumar\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\kumar\.node-red\node_modules\@serialport\bindings
npm ERR! gyp ERR! node -v v12.14.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\kumar\AppData\Local\npm-cache\_logs\2021-09-30T15_15_32_459Z-debug.log

```

I didn't have any other serial window or arduino ide windows open. Also, I've msvc c++ build chain installed.

What is the problem and how can I fix it?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 September 2021 15:47 UTC](https://discourse.nodered.org/t/error-installing-node-red-node-arduino-on-windows-10/51722/2 "2021-09-30T15:47:51Z")

</div>

> [@gyan](#):
>
> `npm ERR! C:\\Users\\kumar\\AppData\\Local\\node-gyp\\Cache\\12.14.0\\x64\\node.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0x4B662D [C:\Users\kumar\.node-red\node_modules\@serialport\bindings\build\bindings.vcxproj]`

Welcome to the forum @gyan

The npm cache may be currupt. Run (in the .node-red folder)  
`npm cache clean --force`  
And just in case  
`sudo npm -g cache clean --force`  
then try again.

---

<div class="post-metadata">

**Author:** ![gyan](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gyan](https://discourse.nodered.org/u/gyan)\
**Post date:** [30 September 2021 16:31 UTC](https://discourse.nodered.org/t/error-installing-node-red-node-arduino-on-windows-10/51722/3 "2021-09-30T16:31:20Z")

</div>

> [@Colin](#):
>
> npm -g cache clean --force

I tried these commands, but it didn't work. I also tried manually deleting the cache folders, but that didn't work either.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 September 2021 16:38 UTC](https://discourse.nodered.org/t/error-installing-node-red-node-arduino-on-windows-10/51722/4 "2021-09-30T16:38:09Z")

</div>

> [@gyan](#):
>
> but it didn't work

Do you mean you still get _exactly_ the same error?

---

<div class="post-metadata">

**Author:** ![gyan](https://avatars.discourse-cdn.com/v4/letter/g/838e76/32.png) [@gyan](https://discourse.nodered.org/u/gyan)\
**Post date:** [30 September 2021 17:17 UTC](https://discourse.nodered.org/t/error-installing-node-red-node-arduino-on-windows-10/51722/5 "2021-09-30T17:17:06Z")

</div>

Yeah, I got the same error.

```auto
npm ERR! code 1
npm ERR! path C:\Users\kumar\.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! Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
npm ERR! serialport.cpp
npm ERR! serialport_win.cpp
npm ERR! win_delay_load_hook.cc
npm ERR! C:\\Users\\kumar\\AppData\\Local\\node-gyp\\Cache\\12.14.0\\x64\\node.lib : fatal error LNK1107: invalid or corrupt file: cannot read at 0x4B662D [C:\Users\kumar\.node-red\node_modules\@serialport\bindings\build\bindings.vcxproj]
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@7.1.2
npm ERR! gyp info using node@12.14.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.7 found at "C:\Users\kumar\AppData\Local\Programs\Python\Python39-64\python.exe"
npm ERR! gyp info find VS using VS2019 (16.10.31410.357) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\kumar\AppData\Local\Programs\Python\Python39-64\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\Users\\kumar\\AppData\\Roaming\\npm\\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\\kumar\\.node-red\\node_modules\\@serialport\\bindings\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\kumar\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\kumar\\AppData\\Local\\node-gyp\\Cache\\12.14.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\\kumar\\AppData\\Local\\node-gyp\\Cache\\12.14.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\kumar\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\kumar\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\12.14.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\Users\\kumar\\.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\\kumar\\.node-red\\node_modules\\@serialport\\bindings\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build/binding.sln',
npm ERR! gyp info spawn args '/clp:Verbosity=minimal',
npm ERR! gyp info spawn args '/nologo',
npm ERR! gyp info spawn args '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onExit (C:\Users\kumar\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:210:5)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "D:\\software installation\\nodejs\\node.exe" "C:\\Users\\kumar\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\kumar\.node-red\node_modules\@serialport\bindings
npm ERR! gyp ERR! node -v v12.14.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\kumar\AppData\Local\npm-cache\_logs\2021-09-30T17_15_39_833Z-debug.log

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [30 September 2021 19:07 UTC](https://discourse.nodered.org/t/error-installing-node-red-node-arduino-on-windows-10/51722/6 "2021-09-30T19:07:05Z")

</div>

> [@gyan](#):
>
> `C:\Users\kumar\.node-red\node_modules\@serialport`

Delete that folder if it exists, then run `npm install`. If that succeeds then try the node install again.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [29 November 2021 19:07 UTC](https://discourse.nodered.org/t/error-installing-node-red-node-arduino-on-windows-10/51722/7 "2021-11-29T19:07:12Z")

</div>

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