Facing problem in installing -node-arduino

Screenshot 2021-11-30 175428
I have been receiving this error. How do I resolve this? I have installed node-red locally on a PC.

Have you done what it says and checked the log for more information?

Yes.

In future when providing logs etc please copy/paste rather then screenshot. When pasting use the </> button at the top of the forum entry window.

Did you install the windows build tools as described in the node red docs for Running on Windows? If you did then please post the full log of the node install error.

Understood. Yes, I installed the windows build tools. Can not post the full log because of character
limitations..

1651 verbose stack Error: @serialport/bindings@8.0.8 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
1651 verbose stack Exit status 1
1651 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
1651 verbose stack     at EventEmitter.emit (events.js:400:28)
1651 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
1651 verbose stack     at ChildProcess.emit (events.js:400:28)
1651 verbose stack     at maybeClose (internal/child_process.js:1058:16)
1651 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)
1652 verbose pkgid @serialport/bindings@8.0.8
1653 verbose cwd C:\Users\chbin\.node-red
1654 verbose Windows_NT 10.0.19044
1655 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--no-audit" "--no-update-notifier" "--no-fund" "--save" "--save-prefix=~" "--production" "--engine-strict" "node-red-node-arduino@0.3.1"
1656 verbose node v14.18.1
1657 verbose npm  v6.14.15
1658 error code ELIFECYCLE
1659 error errno 1
1660 error @serialport/bindings@8.0.8 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
1660 error Exit status 1
1661 error Failed at the @serialport/bindings@8.0.8 install script.
1661 error This is probably not a problem with npm. There is likely additional logging output above.
1662 verbose exit [ 1, true ]

I suspect there is more information earlier in the log. Search it for the word spawn and see if there is anything mentioned earlier. If you can't see it then perhaps you can save the text to a file on a sharing site such as dropbox, Drive or pastebin so we can see it.

Link to the log file

This is the important bit

1642 verbose lifecycle @serialport/bindings@8.0.8~install: CWD: C:\Users\chbin\.node-red\node_modules\@serialport\bindings
1643 silly lifecycle @serialport/bindings@8.0.8~install: Args: [
1643 silly lifecycle   '/d /s /c',
1643 silly lifecycle   'prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild'
1643 silly lifecycle ]
1644 silly lifecycle @serialport/bindings@8.0.8~install: Returned: code: 1  signal: null
1645 info lifecycle @serialport/bindings@8.0.8~install: Failed to exec install script

but it doesn't give an indication of why it is failing. Perhaps more information might be available if you open a terminal, go to your .node-red folder and run
npm install @serialport/bindings@8.0.8
The log from that should be much shorter so you should be able to paste it here.

Still the same error and same size file.

I am attaching lines that I copied from cmd directly.

C:\Users\chbin\.node-red>npm install @serialport/bindings@8.0.8

> @serialport/bindings@8.0.8 install C:\Users\chbin\.node-red\node_modules\@serialport\bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=14.18.1 runtime=node arch=x64 libc= platform=win32)

C:\Users\chbin\.node-red\node_modules\@serialport\bindings>if not defined npm_config_node_gyp (node "C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - "python" is not in PATH or produced an error
gyp ERR! find Python checking if "python2" can be used
gyp ERR! find Python - "python2" is not in PATH or produced an error
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if the py launcher can be used to find Python 2
gyp ERR! find Python - "py.exe" is not in PATH or produced an error
gyp ERR! find Python checking if Python is C:\Python27\python.exe
gyp ERR! find Python - "C:\Python27\python.exe" could not be run
gyp ERR! find Python checking if Python is C:\Python37\python.exe
gyp ERR! find Python - "C:\Python37\python.exe" could not be run
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="C:\Path\To\python.exe"
gyp ERR! find Python   (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python   npm config set python "C:\Path\To\python.exe"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack     at PythonFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:307:47)
gyp ERR! stack     at PythonFinder.runChecks (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:136:21)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:225:16)
gyp ERR! stack     at PythonFinder.execFileCallback (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-python.js:271:16)
gyp ERR! stack     at exithandler (child_process.js:390:5)
gyp ERR! stack     at ChildProcess.errorhandler (child_process.js:402:5)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)
gyp ERR! stack     at onErrorNT (internal/child_process.js:469:16)
gyp ERR! stack     at processTicksAndRejections (internal/process/task_queues.js:82:21)
gyp ERR! System Windows_NT 10.0.19044
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"
gyp ERR! cwd C:\Users\chbin\.node-red\node_modules\@serialport\bindings
gyp ERR! node -v v14.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings@8.0.8 install: `prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@8.0.8 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\chbin\AppData\Roaming\npm-cache\_logs\2021-11-30T17_16_44_689Z-debug.log

C:\Users\chbin\.node-red>

And here is the log file link

How did you install the build tools?

As per instructions given on the "Getting Started" page of the website.

Tell me the right way here, I will reinstall it. Just solve the issues asap as I have a workshop coming up. I am preparing a flow to show how node-red can be used in home/office automation as a part of the workshop.

Did you remember to use the command prompt as Administrator?

Which of the two commands given there did you use? I don't use windows so don't fully understand the difference, but if in doubt I would have used the second one I think.

[Edit] Also how exactly did you install nodejs?

I used instructions on this page Running on Windows

The steps I followed are;

  1. Downloaded the Nodejs installer (16.13.1 LTS)
  2. Ran file.
  3. installed nodejs.
  4. Open cmd as admin
  5. Ran command Using cmd: node --version && npm --version to verify the install.
  6. Ran command npm install -g --unsafe-perm node-red to install node-red.

Btw I am planning on shifting from windows to Linux. Any recommendations?

Node-Red runs nicely on a Raspberry Pi or other small computer, unless you are planning very large flows or lots of data to process.
A Pi Zero2W is OK but it's faster on a Pi 4B. I run it on a Pi 4B without keyboard or monitor and it is sufficiently low powered to be left running all the time.

1 Like

That can't be quite right as you ended up with v14 not 16, but that doesn't matter.

Which command did you use to install the build tools?

If it is not on a pi then my suggestion would be Ubuntu, I think it is the most user friendly for Linux beginners. That is what I use. You can install it alongside Windows and boot into either.

1 Like

How to install build tools? Just tell me the right command.

You have said repeatedly that you have installed them. The instructions are on the page you linked to, down near the bottom. Probably the second option there.

I have installed them " npm install --global --production windows-build-tools "