# Error: EACCES: permission denied, open '/root/.node-red/flows....json'..'

**URL:** <https://discourse.nodered.org/t/error-eacces-permission-denied-open-root-node-red-flows-json/39274>\
**Category:** General\
**Created:** [17 January 2021 16:30 UTC](https://discourse.nodered.org/t/error-eacces-permission-denied-open-root-node-red-flows-json/39274 "2021-01-17T16:30:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![inavarrosevilla](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/inavarrosevilla/32/35522_2.png) [@inavarrosevilla](https://discourse.nodered.org/u/inavarrosevilla)\
**Post date:** [17 January 2021 16:30 UTC](https://discourse.nodered.org/t/error-eacces-permission-denied-open-root-node-red-flows-json/39274/1 "2021-01-17T16:30:47Z")

</div>

Hi for all.  
This is my first post on my life

I'm trying to make a flows backup.  
When execute the file in node in debug windows I see the error on the title

Can anybody helpme? Thanks in advance.

NOTE: I´m nodered and linux beginner and my english isn't very good. Be patience with me please 🙏

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [17 January 2021 18:59 UTC](https://discourse.nodered.org/t/error-eacces-permission-denied-open-root-node-red-flows-json/39274/2 "2021-01-17T18:59:51Z")

</div>

You have a problem with your node-red installation as you have installed it as the root user.

This **will** cause all sorts of issues.

I recommend that you make a copy of `/root/.node_red`

```auto
sudo cp -R /root/.node_red /root/node_red_backup

```

If this is on Pi, next step is:

```auto
sudo chown -r pi:pi /root/node_red_backup

```

which should reset ownership of the copy to the Pi user (I might be slightly off with that command as it is from memory. Run `sudo ls -la /root/node_red_backup` and make sure that the Pi user is actually owner of all of the files and folders.

Now copy that backup to the correct location after getting rid of the unnecessary npm packages

```auto
rm -R /root/node_red_backup/node_modules
mv ~/.node-red ~/.node-red-old
cp /root/node_red_backup ~/.node-red

```

Next, make sure node-red isn't running `service stop node-red` then `cd @/.node-red` and `npm install` . Then run node-red manually and make sure that it is working and using the files in the Pi users home folder and not the root ones.

If you set up node-red to run as a service yourself, make sure that you set the user and group to be a real user as per Dave's install script. Then you should be able to reboot.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [17 January 2021 19:09 UTC](https://discourse.nodered.org/t/error-eacces-permission-denied-open-root-node-red-flows-json/39274/3 "2021-01-17T19:09:32Z")

</div>

> sudo cp -R /root/.node\_red /root/node\_red\_backup  
> ...

OP first needs to switch to another user before doing this.

---

<div class="post-metadata">

**Author:** ![ncherry](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ncherry/32/27_2.png) [@ncherry](https://discourse.nodered.org/u/ncherry)\
**Post date:** [17 January 2021 19:34 UTC](https://discourse.nodered.org/t/error-eacces-permission-denied-open-root-node-red-flows-json/39274/4 "2021-01-17T19:34:35Z")

</div>

Might be a good idea to ask the Original Poster (OP) how well he know Linux. And also what use he was (what user were you logged in as) when you got the error.

---

<div class="post-metadata">

**Author:** ![inavarrosevilla](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/inavarrosevilla/32/35522_2.png) [@inavarrosevilla](https://discourse.nodered.org/u/inavarrosevilla)\
**Post date:** [17 January 2021 20:15 UTC](https://discourse.nodered.org/t/error-eacces-permission-denied-open-root-node-red-flows-json/39274/5 "2021-01-17T20:15:57Z")

</div>

First of all Thanks! I don't know very much of Linux neither it's console, so I'm literally a beginner.  
I think I'm logged as Pi user so the response of @TotallyInformation is a little confusing for me.  
I'm adding a screenshot so you can see my console at the start (pi@....).

It is possible that someone can simplify the idea of @TotallyInformation for me, to try it? I think I previously need to create another user, isn't it?  
[Captura de pantalla 2021-01-17 a las 21.05.23|525x235](https://discourse.nodered.org/uploads/short-url/kAvLGivi8rFNZrQxzfmOhGI9NR6.png)  
And please remember that in the begining, what I want is to backup nodered flows, I can´t think about delete or crash something.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [18 March 2021 20:16 UTC](https://discourse.nodered.org/t/error-eacces-permission-denied-open-root-node-red-flows-json/39274/6 "2021-03-18T20:16:00Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
