Issue with mp4frag node

Hello,

I have been since long been using the great nodes developed & contributed by @kevinGodell

In planning my next generation of video surveillance system with new net cameras, I started to setup a video server solution running in a NVIDIA Jetson Orin Nano Super Developer kit

I’m currently running Node-RED v 4.09 and node version 20.19.0

When I installed the node, everything seems to be ok but when I add the node to the flow, I get an error message as below. I have tried to search the net to find the reason behind but with no success. Does anyone know if this is a node or a Node-RED issue I have stumbled upon?

The same node works fine in a RPi so I wonder if it could be because the NVIDIA has the aarch64 archtecture?

"TypeError: Unexpected ( at 15, expected END: https://git.new/pathToRegexpError"

Walter, can you run npm list express and npm list path-to-regexp in your .node-red directory.

Hello Steve, thanks a lot!

This is the result, does it give any hint?

pi@jetsonOrion:~$ cd .node-red
pi@jetsonOrion:~/.node-red$ npm list express
node-red-project@0.0.1 /home/pi/.node-red
└─┬ @kevingodell/node-red-mp4frag@0.1.1-beta.2
  └── express@5.1.0

pi@jetsonOrion:~/.node-red$ npm list path-to-regexp
node-red-project@0.0.1 /home/pi/.node-red
└─┬ @kevingodell/node-red-mp4frag@0.1.1-beta.2
  └─┬ express@5.1.0
    └─┬ router@2.2.0
      └── path-to-regexp@8.2.0


This is your issue. Changes in express 5 and it's sub dependency path-to-regexp

As far as I can see, Kevin's node did not explicitly request express but it is a peer dependency. When this node was created express was at v4.

You could try npm remove express path-to-regexp followed by npm i express@4 (path-to-regexp v8.0 will be installed by express)

Steve, fantastic!!

This worked perfectly! Thanks a lot!

So this means that anybody that will use this node with later express versions than 4 will face the same problem?

Do you know from which version of Node-RED express v5 was being introduced?

Could I expect any other drawbacks by using v4 instead of v5?

I hope @kevinGodell sees this and hopefully upgrades the node

None. Node-red specifies express 4.x however the core of node-red is not installed where contrib nodes are installed (so it's not really relevant)

And looking at your npm list output, only Kevin's frag node was using it.

As of v7, npm will automatically install peerDependencies if they are not already present, but it will not install a new major version of it already finds a version that works. If you look at the version range specified in the frag nodes package, you will see:

"peerDependencies": {
    "express": ">=4",
    "socket.io": ">=2"
  },
  "peerDependenciesMeta": {
    "express": {
      "optional": false
    },
    "socket.io": {
      "optional": true
    }
  },

What this means is: since nothing else has required any express version it will pick and install v5. Had you installed something like UIBUILDER first (which requires express v4.x), you would have been none-the-wiser.

In short, it might be worth Kevin revising the semver of his peer dependency.

1 Like