Node Red SerialPort Update Did Not Work


I tried to upgrade to version 0.7.0 for the Serial Port Node, and it did not go correctly.
Now I am having difficulty reinstalling it.
I have run npm install node-red-node-serialport, but get the following error when I restart Node Red.

5 Mar 16:48:18 - [warn] Error loading credentials: SyntaxError: Unexpected token in JSON at position 1
5 Mar 16:48:18 - [warn] Error loading flows: Error: Failed to decrypt credentials
5 Mar 16:48:18 - [info] Waiting for missing types to be registered:
5 Mar 16:48:18 - [info] - serial-port (provided by npm module node-red-node-serialport)
5 Mar 16:48:18 - [info] To install any of these missing modules, run:
5 Mar 16:48:18 - [info] npm install
5 Mar 16:48:18 - [info] in the directory:
5 Mar 16:48:18 - [info] \Users\tcontrada.node-red

Any suggestions?



Have you tried following the advice in the log you posted?



I'm not sure what you mean, as I don't see a log file in the .node-red folder??



I deleted 2 serial related folders on the node_modules folder in order to clear out any residual data or files related to the serial node. Then I reinstalled the serial node via npm. Here is the output of the install.

C:\Users\tcontrada.node-red>npm install node-red-node-serialport

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

'prebuild-install' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\tcontrada.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! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:484:19)
gyp ERR! stack at PythonFinder. (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:509:16)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:154:21)
gyp ERR! System Windows_NT 10.0.17134
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\tcontrada.node-red\node_modules@serialport\bindings
gyp ERR! node -v v10.15.1
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN JSON.parse Failed to parse json
npm WARN JSON.parse Unexpected end of JSON input while parsing near ''

npm ERR! errno 1
npm ERR! @serialport/bindings@2.0.7 install: prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@2.0.7 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\tcontrada\AppData\Roaming\npm-cache_logs\2019-03-06T14_44_57_826Z-debug.log

I can't post the log file because it way to large!



Read the part after [quote="tcontrada, post:1, topic:8648"]
5 Mar 16:48:18

in the bit you pasted in post 1



So, I did the install from the .node-red folder, is that what you mean?

Also, this is what my Palate Manager looks like:

And I can't even run my application:

I was supposed to do a demo of my Node Red Application Today, now I can't.
I really need some serious help getting my application working with the Serial Ports!!




First rule of demos if it’s working don’t do an upgrade.

The log told you what you needed to try. From your paste in the first post

To install any of these missing modules, run:
npm install
in the directory:

which is the first thing you should have tried. It might not have fixed it, but if the log suggests doing something it’s easier to try it than post here (and a lot quicker!)

Your later post suggests that it can’t find python and also shows which operating system you are running, something it’s worth including when you post asking for help.

Have you installed the build tools as described on the Node-RED page for installing on windows?

If not, install the build tools. Reboot your machine and then try installing again.



I did what you suggested, but getting exactly the same result even after trying to install the Serial Port Node.
6 Mar 15:33:33 - [info] Waiting for missing types to be registered:
6 Mar 15:33:33 - [info] - serial-port (provided by npm module node-red-node-serialport)
6 Mar 15:33:33 - [info] To install any of these missing modules, run:
6 Mar 15:33:33 - [info] npm install
6 Mar 15:33:33 - [info] in the directory:
6 Mar 15:33:33 - [info] \Users\tcontrada.node-red

Is Python required for the 0.7.0 Serial Port Node vs. the previous version?



did you install the build tools?



Should not be necessary.. it should fall back to the prebuilt version for windows installs.

npm i node-red-node-serialport

> @serialport/bindings@2.0.7 install C:\test\node_modules\@serialport\bindings
> prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

npm WARN saveError ENOENT: no such file or directory, open 'C:\test\package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open 'C:\test\package.json'
npm WARN temp No description
npm WARN temp No repository field.
npm WARN temp No README data
npm WARN temp No license field.

+ node-red-node-serialport@0.7.1
added 79 packages from 46 contributors and audited 144 packages in 7.563s
found 0 vulnerabilities


I did install the Build Tools, but Python did not get installed because it required PowerShell Admin Rights.

So, I did the Build Tools Again in Powershell with Admin rights. Worked fine and Python 2.7 also got installed! Great!

Next I put Python.exe in the Environment path...
Finally, I ran npm i node-red-node-serialport from the .node-red folder. It seemed to install fine.

I brought up my node red IDE page and the Serial Port Nodes were displayed!! Great!
I wired up the serial nodes and my application is now running fine!

This was a bit tiresome and I did not have python installed with the previous version of the Serial Port nodes.

I think there may have to be some dependency install of python before upgrading the serial port nodes.

Much thanks for the help. I thought I was going to have to rebuild my entire application with a clean, fresh node red install.

1 Like