Installing new nodes, problems doing in and problems with what I have written down as THE way to do it

Hi folks.
(A bit long I know. But I want as many cards on the table to quickly resolve the problem, rather than umpteen posts to and fro before the real problem is found/identified.)

I really hope this is not time wasteful for the gurus but this is not making sense.

(No offence to the guy who did the node, but this is more with the steps taken to install it and get it working.)

way back when I knew little of the right way to install nodes from the CLI/terminal. Let alone installing NR, and other stuff.

Suffice to say Nick (after a lot of messages) nutted out I had done it all (or most) the wrong way.
(To do with ownership, and permissions.)
I won't pretend to exactly understand what it all means, but I did the chown....... stuff that was shown to me and it all worked - at that time for that scenario.

But given I goofed and what I did was a global change it resolved any future issues with getting it done again.

I also was told that I do not sudo when I installing packages. That is clearly pointed out as the command is not prefixed with sudo.

Bottom line:
I wrote down that I do not need sudo when installing packages.

. (space to help with reading)
.

So: npm install node-red-contrib-ui-media
I did it from the web page. Installed it, no complaints, no know errors.

It didn't/doesn't work. Why is beyond the scope here/now.

What is the hitch is this:
Today I get a reply and am asked to do some things.
NR is already loaded - this machine: ubuntu - and I search for ui_media on the left of the screen.
nothing
(Grrrr!)
I open palette manager and search for it.
I get this:
(See below)

Yeah, what ever. (I don't "get" what that means.) I'll try again.
I uninstall it and re-install it.
It is there. (Going off topic. Back to REAL TOPIC now)
I remove it (again) and it isn't there.
I go to the CLI and install it from there to see if there are any errors.
This is because it doesn't seem to give any errors (the "view log" button disappears too quickly - which to me means there are no problems - but I've been caught thinking too much before, so I wanted to be sure.

me@me-desktop:~/.node-red$ npm install node-red-contrib-ui-media
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.

+ node-red-contrib-ui-media@1.0.3
added 4 packages from 5 contributors and audited 1212 packages in 3.806s
found 4 vulnerabilities (2 low, 2 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details

Seems to be ok. No errors.
But, it isn't installed.
** note: I also force refresh the page to be 100% sure. Nothing.
Ok, I'll remove it - again.

me@me-desktop:~/.node-red$ npm remove node-red-contrib-ui-media
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.

removed 4 packages and audited 1206 packages in 2.495s
found 4 vulnerabilities (2 low, 2 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details

I keep seeing this "errors.... run npm audit fix to fix them."

Granted it isn't in the (known) scope of the problem but I'll try.

me@me-desktop:~/.node-red$ npm audit fix
npm ERR! path /home/me/.npm/index-v5/2b/b7/5605911c6e8a323c274c5905a25a7425d38df8289efa2b50cc0e37b1dd4e
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall open
npm ERR! Error: EACCES: permission denied, open '/home/me/.npm/index-v5/2b/b7/5605911c6e8a323c274c5905a25a7425d38df8289efa2b50cc0e37b1dd4e'
npm ERR!  { Error: EACCES: permission denied, open '/home/me/.npm/index-v5/2b/b7/5605911c6e8a323c274c5905a25a7425d38df8289efa2b50cc0e37b1dd4e'
npm ERR!   cause: 
npm ERR!    { Er

error - premission DENIED

To me that's a sudo problem.

Just for clarity:

This is what I need clarified:
**
when/where do I need (if at all) sudo when doing npm stuff?
**

What do you mean you did it from the web page? You must do it from your .node-red folder.

Did you restart node-red after installing from the command line? When installing from the command line it is necessary to restart before the node will be seen.

You have been advised on at least one occasion not to run audit fix. Whether it has done any damage remains to be seen. If it didn't say it had updated anything then probably not.

As for the error at the bottom of your post, when something like that is going on, the first thing is always to look at the node-red log. I am sure you know how to do this already, but just in case

node-red-stop
node-red-start

Sorry.

"From the web"..... Palette manager.

This "illusive" node-red log.....

I know there is a log in:
/var/log/nodered-install.log

I know there is a command something like:
sudo journalctl -f -u nodered -o cat that does . . . . . something.
I get it starts to show a log from then, but ...... Anything else: sorry.

I have had it listed but it just won't work when I try to deploy it.

Sorry for the order of the pictures. I have been taking a lot of piccies just recently.

![Screenshot%20from%202019-04-06%2021-39-53|690x389]
(upload://eMcINtH5hpTwldXg7cVclLzoFDc.png)

That looks like a bug on that node, please raise an issue on their github page

I told you how to get the log, to quote from my previous message:
I am sure you know how to do this already, but just in case

node-red-stop
node-red-start

Colin:

And I asked for clarity on *where said log is.
As in the one which is in the CLI when I do the latter command? Ok.
But when is it enough for you to know?

Log coming soon.

Right here it is so far:

me@me-desktop:~/.node-red$ node-red-stop

Stop Node-RED
 
Use   node-red-start   to start Node-RED again
 
me@me-desktop:~/.node-red$ npm install node-red-contrib-ui-media
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.

+ node-red-contrib-ui-media@1.0.3
updated 1 package and audited 1212 packages in 4.012s
found 4 vulnerabilities (2 low, 2 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details
me@me-desktop:~/.node-red$ node-red-start

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.0.6:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as a systemd service.
7 Apr 18:28:10 - [info]
Welcome to Node-RED
===================
7 Apr 18:28:10 - [info] Node-RED version: v0.20.3
7 Apr 18:28:10 - [info] Node.js  version: v8.15.1
7 Apr 18:28:10 - [info] Linux 4.15.0-46-generic x64 LE
7 Apr 18:28:10 - [info] Loading palette nodes
7 Apr 18:28:10 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
7 Apr 18:28:10 - [warn] rpi-gpio : Cannot find Pi RPi.GPIO python library
node-red-contrib-jktestEditableList - initialising module. Module Version: 0.1.1
node-red-contrib-jktestEditableList - loading module
7 Apr 18:28:11 - [info] Dashboard version 2.14.0 started at /ui
7 Apr 18:28:11 - [warn] ------------------------------------------------------
7 Apr 18:28:11 - [warn] [node-red-contrib-ui-media/ui_media] TypeError: Cannot read property 'projects' of undefined (line:29)
7 Apr 18:28:11 - [warn] ------------------------------------------------------
7 Apr 18:28:11 - [info] Settings file  : /home/me/.node-red/settings.js
7 Apr 18:28:11 - [info] HTTP Static    : /home/me/.node-red/public
7 Apr 18:28:11 - [info] Context store  : 'default' [module=memory]
7 Apr 18:28:11 - [info] User directory : /home/me/.node-red
7 Apr 18:28:11 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
7 Apr 18:28:11 - [info] Flows file     : /home/me/.node-red/flows_me-desktop.json
7 Apr 18:28:11 - [info] Server now running at http://127.0.0.1:1880/
7 Apr 18:28:11 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
7 Apr 18:28:11 - [info] Starting flows
7 Apr 18:28:11 - [info] [tcp in:MySensors Gateway] connecting to 192.168.1.20:5003
7 Apr 18:28:12 - [info] uibuilder:uibuilder: UI Builder Version 1.2.2 started at URL /uibuilder
7 Apr 18:28:12 - [info] uibuilder:uibuilder: UI Source files at /home/me/.node-red/uibuilder/uibuilder
7 Apr 18:28:12 - [info] Started flows
7 Apr 18:28:12 - [error] [function:build array (1)] TypeError: Cannot read property 'shift' of undefined
7 Apr 18:28:12 - [info] [mqtt-broker:MQTT host] Connected to broker: mqtt://192.168.0.99:1883
7 Apr 18:28:12 - [info] [mqtt-broker:MQTT host] Connected to broker: mqtt://192.168.0.99:1883
7 Apr 18:28:12 - [info] [mqtt-broker:MQTT host] Connected to broker: mqtt://192.168.0.99:1883

So this is what I get when I go to NR and look at the palette manager:

I have raised an issue.
I was wanting to check the methodology I used before it happened and if there was a problem in what I was/am doing.

You have an error in that function too.

I see you haven't yet post the node red log in that issue, that is probably all that is needed for the author to work out the problem.

The image mentioning line 29 is the one that is needed. So should be enough for them to fix

Excuse me?
From the git hub page:

7 Apr 08:09:05 - [info] [mqtt-broker:MQTT host] Connection failed to broker: mqtt://192.168.0.99:1883
7 Apr 08:09:05 - [info] [mqtt-broker:MQTT host] Connection failed to broker: mqtt://192.168.0.99:1883
7 Apr 08:09:22 - [info] [mqtt-broker:MQTT host] Connection failed to broker: mqtt://192.168.0.99:1883
7 Apr 08:09:22 - [info] [mqtt-broker:MQTT host] Connection failed to broker: mqtt://192.168.0.99:1883
7 Apr 08:09:29 - [info] Stopping modified nodes
7 Apr 08:09:29 - [info] Stopped modified nodes
7 Apr 08:09:29 - [info] Waiting for missing types to be registered:
7 Apr 08:09:29 - [info] - ui_media

I have posted it.

I am waiting for a reply.

AGAIN: I am asking here for clarity on how I went about it and the confusion with the "denied access" message I got.

In that function too?

C'mon..... Which is that function?

If I delete/un-install that node (ui_media), the problem goes away.

What was the command you used that gave that message and why were you doing that?

You had not posted the startup log with the line 29 error, though as pointed out by Dave it is in the images you posted.

C'mon, read the error message.
[error] [function:build array (1)]
It tells you the name of the function. The reason the error disappears when you remove the ui-media node may be because you are passing the function different data, or not calling it at all.

(from the first post in the thread)
npm install node-red-contrib-ui-media

I did this because when I installed it from the palette manager and tried to use it, the node barfed with an error.

I posted this originally:

me@me-desktop:~/.node-red$ node-red-stop

Stop Node-RED
 
Use   node-red-start   to start Node-RED again
 
me@me-desktop:~/.node-red$ npm install node-red-contrib-ui-media
npm WARN node-red-project@0.0.1 No repository field.
npm WARN node-red-project@0.0.1 No license field.

+ node-red-contrib-ui-media@1.0.3
updated 1 package and audited 1212 packages in 4.012s
found 4 vulnerabilities (2 low, 2 moderate)
  run `npm audit fix` to fix them, or `npm audit` for details
me@me-desktop:~/.node-red$ node-red-start

Start Node-RED
 
Once Node-RED has started, point a browser at http://192.168.0.6:1880
On Pi Node-RED works better with the Firefox or Chrome browser
 
Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   node-red-log                           to view the recent log output
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot
 
To find more nodes and example flows - go to http://flows.nodered.org
 
Starting as a systemd service.
7 Apr 18:28:10 - [info]
Welcome to Node-RED
===================
7 Apr 18:28:10 - [info] Node-RED version: v0.20.3
7 Apr 18:28:10 - [info] Node.js  version: v8.15.1
7 Apr 18:28:10 - [info] Linux 4.15.0-46-generic x64 LE
7 Apr 18:28:10 - [info] Loading palette nodes
7 Apr 18:28:10 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
7 Apr 18:28:10 - [warn] rpi-gpio : Cannot find Pi RPi.GPIO python library
node-red-contrib-jktestEditableList - initialising module. Module Version: 0.1.1
node-red-contrib-jktestEditableList - loading module
7 Apr 18:28:11 - [info] Dashboard version 2.14.0 started at /ui
7 Apr 18:28:11 - [warn] ------------------------------------------------------
7 Apr 18:28:11 - [warn] [node-red-contrib-ui-media/ui_media] TypeError: Cannot read property 'projects' of undefined (line:29)
7 Apr 18:28:11 - [warn] ------------------------------------------------------
7 Apr 18:28:11 - [info] Settings file  : /home/me/.node-red/settings.js
7 Apr 18:28:11 - [info] HTTP Static    : /home/me/.node-red/public
7 Apr 18:28:11 - [info] Context store  : 'default' [module=memory]
7 Apr 18:28:11 - [info] User directory : /home/me/.node-red
7 Apr 18:28:11 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
7 Apr 18:28:11 - [info] Flows file     : /home/me/.node-red/flows_me-desktop.json
7 Apr 18:28:11 - [info] Server now running at http://127.0.0.1:1880/
7 Apr 18:28:11 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
7 Apr 18:28:11 - [info] Starting flows
7 Apr 18:28:11 - [info] [tcp in:MySensors Gateway] connecting to 192.168.1.20:5003
7 Apr 18:28:12 - [info] uibuilder:uibuilder: UI Builder Version 1.2.2 started at URL /uibuilder
7 Apr 18:28:12 - [info] uibuilder:uibuilder: UI Source files at /home/me/.node-red/uibuilder/uibuilder
7 Apr 18:28:12 - [info] Started flows
7 Apr 18:28:12 - [error] [function:build array (1)] TypeError: Cannot read property 'shift' of undefined
7 Apr 18:28:12 - [info] [mqtt-broker:MQTT host] Connected to broker: mqtt://192.168.0.99:1883
7 Apr 18:28:12 - [info] [mqtt-broker:MQTT host] Connected to broker: mqtt://192.168.0.99:1883
7 Apr 18:28:12 - [info] [mqtt-broker:MQTT host] Connected to broker

But I may have not caught the error because I do not leave the terminal open all the time.
However, I posted a quote from the github page where I gave the error.

What more is needed?

Calm down guys.
Colin there is more than enough in the issue raised for them to fix the problem.
While we always ask for logs, what we are trying to find is something that as closely as possible identifies a line where the error is. In this case it happens to be that screenshot.

That is the command that gave the access error, not the install.

Yes, I said that.

Colin:

Correct.

The node installed happily but has an inherent error.

I was asking (probably now in a very hard to find part of the thread) why did I get an "access denied" error when I was told I don't need to use sudo when installing nodes.

I wanted to check what I was doing was right because although I had done it before: I was told the correct way to do it. I thought I was doing than and was getting an error.

That required me to ask.

The reason you got the Access Denied error is nothing to do with installing the ui-media node, it is because you ran the npm audit command. You should not run that command.