bartbutenaers / node-red-contrib-onvif-nodes

Node Red nodes for communicating with OnVif compliant IP devices
Apache License 2.0
65 stars 25 forks source link

Installation failed #34

Closed EvertDekker closed 1 year ago

EvertDekker commented 1 year ago

Hi Bart,

Trying to install the onvif nodes, but get some error's. _pi@RaspBroker:~/.node-red $ npm install node-red-contrib-onvif-nodes@0.0.1-beta.16_

I'm not that Javascript expert, but it looks like that the nodes want dashboard version 2?

`npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: node-red-contrib-ui-mp4frag@0.1.0-beta.2 npm ERR! Found: node-red-dashboard@3.2.3 npm ERR! node_modules/node-red-dashboard npm ERR! peer node-red-dashboard@">=2.23.3" from node-red-contrib-ui-led@0.4.11 npm ERR! node_modules/node-red-contrib-ui-led npm ERR! node-red-contrib-ui-led@"~0.4.11" from the root project npm ERR! peer node-red-dashboard@">2.16.0" from node-red-node-ui-table@0.4.3 npm ERR! node_modules/node-red-node-ui-table npm ERR! node-red-node-ui-table@"~0.4.3" from the root project npm ERR! 1 more (the root project) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer node-red-dashboard@"^2.26.1" from node-red-contrib-ui-mp4frag@0.1.0-beta.2 npm ERR! node_modules/node-red-contrib-ui-mp4frag npm ERR! node-red-contrib-ui-mp4frag@"github:kevinGodell/node-red-contrib-ui-mp4frag" from the root project npm ERR! npm ERR! Conflicting peer dependency: node-red-dashboard@2.30.0 npm ERR! node_modules/node-red-dashboard npm ERR! peer node-red-dashboard@"^2.26.1" from node-red-contrib-ui-mp4frag@0.1.0-beta.2 npm ERR! node_modules/node-red-contrib-ui-mp4frag npm ERR! node-red-contrib-ui-mp4frag@"github:kevinGodell/node-red-contrib-ui-mp4frag" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force, or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! See /home/pi/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2023-03-26T12_14_39_596Z-debug-0.log `

Node v16.19.0, Npm v8.19.3

Is there a simple workaround without breaking my precious nodered flow's ;-)

bartbutenaers commented 1 year ago

Hi Evert,

No this onvif node only has two dependencies, as you can see in my package.json file. Nothing about dashboard, since the onvif node is not a UI node.

I see this in your log:

npm ERR! peer node-red-dashboard@"^2.26.1" from node-red-contrib-ui-mp4frag@0.1.0-beta.2

As you can see in Kevin's package.json file, his UI node has a dependency to the dashboard.

I am by FAR an npm expert, so you may have more luck to ask this question on Discourse.

Although I think I had a similar issue some time ago, and (as you can see here) also with Kevin's nodes. Because Kevin recently published his mp4frag related nodes on npm, but at the same time he has grouped them in a namespace "@kevingodell". I didn't have time to look at the details of this issue, but this is what I "think" is happening:

  1. You want to install my onvif node via npm install

  2. When you install a new package, npm will automatically check your .../.node-red/package.json file for all of your Node-RED dependencies. Because every dependency that you have installed in your .../.node-red folder in the past, are added to this package.json file!

  3. If any of those dependencies are missing or outdated, npm will automatically attempt to update or install them as well to ensure that your project has ALL the required dependencies to function properly. So npm even checks your previously installed packages, to make sure they are compatilbe with the new package that you want to install. By having a valid dependency tree, npm makes sure that your Node-RED can run without problems.

  4. However in that package.json file is a link to Kevin's nodes which you have installed in the past from Github. However Kevin recently published his mp4frag nodes to npm, and he grouped all his nodes in a namespace "@kevingodell".

  5. Since that link to install Kevin's nodes from Github isn't valid anymore, the npm install fails.

So I had to replace the github url's to Kevin's repos, by references to his npm packages:

image

I think I have just removed the entries (that caused errors) one by one from my package json file. And afterwards when the npm install of the onvif nodes works, then you can do an npm install of each package again (which you had previously removed from your package.json file.

Summarized: an npm install will force you to cleanup all garbage in your package.json file, which has become invalid since the last time you runned an npm install..

On discourse they adviced me to create a copy of the entire .node-red folder, in case something goes wrong. And the experts are on Discourse, not here ;-)

Bart

EvertDekker commented 1 year ago

Hi Bart, Thanks for the tips and hints. Will try the suggested ones.

Evert

EvertDekker commented 1 year ago

Changing the all the entry's from Kevin in "Github:kevingodell/...." to "@kevingodell/......" in package.json file file did the trick for me. Thanks for your help again. Onvif nodes are now working.

bartbutenaers commented 1 year ago

Hi Evert, Glad to hear that it is now working for you. Yes indeed when somebody changes the name/path of his node, then you are screwed the first next time that you do an npm install of another node. And the confusing part is that you think that it is related to the node you are installing at this moment, which is not the case.

BTW you can also post comments in closed issues.

Enjoy your weekend!