Cannot install node-red-contrib-lgtv, errors

I tried to install node-red-contrib-lgtv (and also any of the other lg tv and webos paletts) but get these errors:

2025-09-27T13:29:10.908Z Install : node-red-contrib-lgtv 1.1.0

2025-09-27T13:29:13.578Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --omit=dev --engine-strict node-red-contrib-lgtv@1.1.0
2025-09-27T13:29:17.310Z [err] npm
2025-09-27T13:29:17.310Z [err]  WARN deprecated
2025-09-27T13:29:17.310Z [err]  yaeti@0.0.6: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
2025-09-27T13:29:18.127Z [err] npm WARN cleanup
2025-09-27T13:29:18.127Z [err]  Failed to remove some directories [
2025-09-27T13:29:18.127Z [err] npm WARN 
2025-09-27T13:29:18.127Z [err] cleanup   [
2025-09-27T13:29:18.127Z [err] npm WARN 
2025-09-27T13:29:18.127Z [err] cleanup     'C:\\Users\\lenov\\.node-red\\node_modules\\utf-8-validate',
2025-09-27T13:29:18.127Z [err] npm WARN 
2025-09-27T13:29:18.127Z [err] cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\lenov\.node-red\node_modules\utf-8-validate'] {
2025-09-27T13:29:18.127Z [err] npm WARN
2025-09-27T13:29:18.128Z [err]  cleanup       errno: -4082,
2025-09-27T13:29:18.128Z [err] npm 
2025-09-27T13:29:18.128Z [err] WARN cleanup       code: 'EBUSY',
2025-09-27T13:29:18.128Z [err] npm
2025-09-27T13:29:18.128Z [err]  WARN cleanup       syscall: 'rmdir',
2025-09-27T13:29:18.128Z [err] npm WARN cleanup
2025-09-27T13:29:18.128Z [err]        path: 'C:\\Users\\lenov\\.node-red\\node_modules\\utf-8-validate'
2025-09-27T13:29:18.128Z [err] npm 
2025-09-27T13:29:18.128Z [err] WARN cleanup
2025-09-27T13:29:18.128Z [err]      }
2025-09-27T13:29:18.128Z [err] npm WARN 
2025-09-27T13:29:18.128Z [err] cleanup   ],
2025-09-27T13:29:18.128Z [err] npm WARN
2025-09-27T13:29:18.128Z [err]  cleanup   [
2025-09-27T13:29:18.128Z [err] npm 
2025-09-27T13:29:18.128Z [err] WARN cleanup     'C:\\Users\\lenov\\.node-red\\node_modules\\utf-8-validate',
2025-09-27T13:29:18.128Z [err] npm
2025-09-27T13:29:18.128Z [err]  WARN cleanup     [Error: EBUSY: resource busy or locked, rmdir 'C:\Users\lenov\.node-red\node_modules\utf-8-validate'] {
2025-09-27T13:29:18.128Z [err] npm WARN cleanup       errno: -4082,
2025-09-27T13:29:18.128Z [err] npm
2025-09-27T13:29:18.128Z [err]  WARN cleanup       code: 'EBUSY',
2025-09-27T13:29:18.128Z [err] npm
2025-09-27T13:29:18.128Z [err]  WARN cleanup       syscall: 'rmdir',
2025-09-27T13:29:18.128Z [err] npm WARN cleanup       path: 'C:\\Users\\lenov\\.node-red\\node_modules\\utf-8-validate'
2025-09-27T13:29:18.128Z [err] npm WARN cleanup
2025-09-27T13:29:18.128Z [err]      }
2025-09-27T13:29:18.128Z [err] npm WARN 
2025-09-27T13:29:18.128Z [err] cleanup   ],
2025-09-27T13:29:18.128Z [err] npm WARN
2025-09-27T13:29:18.128Z [err]  cleanup   [
2025-09-27T13:29:18.128Z [err] npm 
2025-09-27T13:29:18.128Z [err] WARN cleanup     'C:\\Users\\lenov\\.node-red\\node_modules\\es5-ext',
2025-09-27T13:29:18.128Z [err] npm
2025-09-27T13:29:18.128Z [err]  WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\lenov\.node-red\node_modules\es5-ext\string\#'] {
2025-09-27T13:29:18.128Z [err] npm WARN cleanup
2025-09-27T13:29:18.128Z [err]        errno: -4048,
2025-09-27T13:29:18.128Z [err] npm WARN 
2025-09-27T13:29:18.128Z [err] cleanup       code: 'EPERM',
2025-09-27T13:29:18.128Z [err] npm WARN
2025-09-27T13:29:18.128Z [err]  cleanup       syscall: 'rmdir',
2025-09-27T13:29:18.128Z [err] npm 
2025-09-27T13:29:18.128Z [err] WARN cleanup       path: 'C:\\Users\\lenov\\.node-red\\node_modules\\es5-ext\\string\\#'
2025-09-27T13:29:18.128Z [err] npm
2025-09-27T13:29:18.128Z [err]  WARN cleanup     }
2025-09-27T13:29:18.128Z [err] npm
2025-09-27T13:29:18.128Z [err]  WARN cleanup   ]
2025-09-27T13:29:18.128Z [err] npm WARN cleanup ]
2025-09-27T13:29:18.226Z [err] npm ERR! code 1
2025-09-27T13:29:18.226Z [err] npm ERR! path C:\Users\lenov\.node-red\node_modules\bufferutil
2025-09-27T13:29:18.227Z [err] npm ERR! command failed
2025-09-27T13:29:18.227Z [err] npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp-build
2025-09-27T13:29:18.227Z [err] npm ERR! node:internal/child_process:420
2025-09-27T13:29:18.227Z [err] npm ERR!     throw new ErrnoException(err, 'spawn');
2025-09-27T13:29:18.227Z [err] npm ERR!     ^
2025-09-27T13:29:18.227Z [err] npm ERR! 
2025-09-27T13:29:18.227Z [err] npm ERR! Error: spawn EINVAL
2025-09-27T13:29:18.227Z [err] npm ERR!     at ChildProcess.spawn (node:internal/child_process:420:11)
2025-09-27T13:29:18.227Z [err] npm ERR!     at Object.spawn (node:child_process:762:9)
2025-09-27T13:29:18.227Z [err] npm ERR!     at build (C:\Users\lenov\.node-red\node_modules\node-gyp-build\bin.js:29:8)
2025-09-27T13:29:18.227Z [err] npm ERR!     at preinstall (C:\Users\lenov\.node-red\node_modules\node-gyp-build\bin.js:38:32)
2025-09-27T13:29:18.227Z [err] npm ERR!     at C:\Users\lenov\.node-red\node_modules\node-gyp-build\bin.js:11:7
2025-09-27T13:29:18.227Z [err] npm ERR!     at ChildProcess.exithandler (node:child_process:430:5)
2025-09-27T13:29:18.227Z [err] npm
2025-09-27T13:29:18.227Z [err]  ERR!     at ChildProcess.emit (node:events:524:28)
2025-09-27T13:29:18.227Z [err] npm
2025-09-27T13:29:18.227Z [err]  ERR!
2025-09-27T13:29:18.227Z [err]      at maybeClose (node:internal/child_process:1104:16)
2025-09-27T13:29:18.227Z [err] npm 
2025-09-27T13:29:18.227Z [err] ERR!
2025-09-27T13:29:18.227Z [err]      at ChildProcess._handle.onexit (node:internal/child_process:304:5) {
2025-09-27T13:29:18.227Z [err] npm 
2025-09-27T13:29:18.227Z [err] ERR!
2025-09-27T13:29:18.227Z [err]    errno: -4071,
2025-09-27T13:29:18.227Z [err] npm ERR!
2025-09-27T13:29:18.227Z [err]    code: 'EINVAL',
2025-09-27T13:29:18.227Z [err] npm 
2025-09-27T13:29:18.227Z [err] ERR!
2025-09-27T13:29:18.227Z [err]    syscall: 'spawn'
2025-09-27T13:29:18.227Z [err] npm ERR! }
2025-09-27T13:29:18.227Z [err] npm ERR!
2025-09-27T13:29:18.228Z [err]  
2025-09-27T13:29:18.228Z [err] npm ERR! Node.js v20.19.4

Just a guess (I don't use Windows), but when you installed nodejs did you tick the box to tell it to install the build tools?

Yes, pretty sure I did

OK, in that case I think you will have to wait for a Windows user to help.

What version of node-red are you running?

Try restarting computer (to release any locks on files and folders). If node-red auto starts, stop it. If necessary, kill all processes npm and node in the taskmanager -> details and delete the mentioned directories. In fact, you can safely delete C:\Users\lenov\.node-red\node_modules and then run npm i (in a non-administrative terminal from dir C:\Users\lenov\.node-red\) to reinstall everything (which will also have the benefit of correcting any permissions issues if any were set incorrectly)

That did not work.

2025-10-04T11:36:51.834Z Install : node-red-contrib-lgtv 1.1.0

2025-10-04T11:36:51.923Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --omit=dev --engine-strict node-red-contrib-lgtv@1.1.0
2025-10-04T11:36:56.157Z [err] npm
2025-10-04T11:36:56.161Z [err]  WARN deprecated yaeti@0.0.6: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
2025-10-04T11:36:56.621Z [err] npm ERR! code
2025-10-04T11:36:56.621Z [err]  1
2025-10-04T11:36:56.621Z [err] npm ERR! path C:\Users\lenov\.node-red\node_modules\bufferutil
2025-10-04T11:36:56.622Z [err] npm ERR! command failed
2025-10-04T11:36:56.623Z [err] npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp-build
2025-10-04T11:36:56.623Z [err] npm ERR! node:internal/child_process:420
2025-10-04T11:36:56.623Z [err] npm ERR!     throw new ErrnoException(err, 'spawn');
2025-10-04T11:36:56.623Z [err] npm ERR!
2025-10-04T11:36:56.623Z [err]      ^
2025-10-04T11:36:56.623Z [err] npm ERR! 
2025-10-04T11:36:56.623Z [err] npm ERR!
2025-10-04T11:36:56.623Z [err]  Error: spawn EINVAL
2025-10-04T11:36:56.623Z [err] npm ERR!     at ChildProcess.spawn (node:internal/child_process:420:11)
2025-10-04T11:36:56.623Z [err] npm 
2025-10-04T11:36:56.623Z [err] ERR!     at Object.spawn (node:child_process:762:9)
2025-10-04T11:36:56.623Z [err] npm ERR!     at build (C:\Users\lenov\.node-red\node_modules\node-gyp-build\bin.js:29:8)
2025-10-04T11:36:56.623Z [err] npm
2025-10-04T11:36:56.623Z [err]  ERR!     at preinstall (C:\Users\lenov\.node-red\node_modules\node-gyp-build\bin.js:38:32)
2025-10-04T11:36:56.623Z [err] npm ERR!     at C:\Users\lenov\.node-red\node_modules\node-gyp-build\bin.js:11:7
2025-10-04T11:36:56.623Z [err] npm ERR!     at ChildProcess.exithandler (node:child_process:430:5)
2025-10-04T11:36:56.623Z [err] npm
2025-10-04T11:36:56.623Z [err]  ERR!     at ChildProcess.emit (node:events:524:28)
2025-10-04T11:36:56.623Z [err] npm ERR!     at maybeClose (node:internal/child_process:1104:16)
2025-10-04T11:36:56.623Z [err] npm ERR!
2025-10-04T11:36:56.623Z [err]      at ChildProcess._handle.onexit (node:internal/child_process:304:5) {
2025-10-04T11:36:56.623Z [err] npm ERR!   errno: -4071,
2025-10-04T11:36:56.623Z [err] npm
2025-10-04T11:36:56.623Z [err]  ERR!   code: 'EINVAL',
2025-10-04T11:36:56.623Z [err] npm ERR!
2025-10-04T11:36:56.623Z [err]    syscall: 'spawn'
2025-10-04T11:36:56.623Z [err] npm ERR!
2025-10-04T11:36:56.623Z [err]  }
2025-10-04T11:36:56.623Z [err] npm ERR! 
2025-10-04T11:36:56.623Z [err] npm
2025-10-04T11:36:56.623Z [err]  ERR! Node.js v20.19.4
2025-10-04T11:36:56.624Z [err] 
2025-10-04T11:36:56.624Z [err] npm ERR! A complete log of this run can be found in: C:\Users\lenov\AppData\Local\npm-cache\_logs\2025-10-04T11_36_52_543Z-debug-0.log
2025-10-04T11:36:56.645Z rc=1

Did the npm install after deleting the node_modules folder work without error?

yes it did