Settings.js "Error writing settings.js:Permission denied"

#1

Trying to set the a Username and Password for Node Red.

The instructions require that in "settings.js" be modfied.

I have edited the field and removed the comment //.
Then tried to save by pressing ctrl+o ( ^o)
However i get Error " Error writing settings.js: Permission denied"

Any suggestions?

adminAuth:{
type: "credentials",
.....
.....
},

0 Likes

#2

figured it out. need to enter sudo nano settings.js ( forgot to type in the sudo)

0 Likes

#3

Which settings.is are you editing? If you look at the node red log it will tell you which one it is using. Normally this will be .node-red/settings.js and should not need sudo to edit.

1 Like

#4

Thank you Collin.
During bootup, the PI shows that following path name:
"usr/lib/node_modules/node-red/settings.js"

the Node Red was installed from the NOOB installation

  1. I am pretty confused on where the settings.js file should be.
    Is the settings.js supposed to be located elsewhere?
0 Likes

#5

You should run the bash <(curl upgrade script from the pi installation docs [1]. Then your flows file and settings.js should be in ~/.node-red. The pre-installed node-red is out of date.

[1] https://nodered.org/docs/hardware/raspberrypi

0 Likes

#6

Normally on first run the settings.js file gets copied to ~/.node-red/ directory and is used from there. There are a few reasons why this may not happen (which I can’t recall). You could move it manually I think.

0 Likes

#7

Thank you Colin.
Ran the bash < curl( ) as you suggested. The directories are all in the /pi/home now.
THank you

0 Likes