# Error: EACCES: permission denied

**URL:** <https://discourse.nodered.org/t/error-eacces-permission-denied/32117>\
**Category:** General\
**Created:** [27 August 2020 18:26 UTC](https://discourse.nodered.org/t/error-eacces-permission-denied/32117 "2020-08-27T18:26:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zerg](https://avatars.discourse-cdn.com/v4/letter/z/6de8d8/32.png) [@Zerg](https://discourse.nodered.org/u/Zerg)\
**Post date:** [27 August 2020 18:26 UTC](https://discourse.nodered.org/t/error-eacces-permission-denied/32117/1 "2020-08-27T18:26:10Z")

</div>

According to this instruction: [A guide to understanding 'Persistent Context'](https://discourse.nodered.org/t/a-guide-to-understanding-persistent-context/4115)  
I changed the settings in the **settings.js** file  
I just uncommented some lines.

And now I have this

```auto
    // Context Storage
    // The following property can be used to enable context storage. The configuration
    // provided here will enable file-based context that flushes to disk every 30 seconds.
    // Refer to the documentation for further options: https://nodered.org/docs/api/context/
    //
    contextStorage: {
       default: {
           module:"localfilesystem"
       },
    },

```

And now in debug window write an error at regular intervals: **"Error writing context: Error: EACCES: permission denied, mkdir '/home/user/.node-red/context/c58788ff.b5f1a8'"**

How to find out, what rights should i need to give? and to whom?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 August 2020 19:43 UTC](https://discourse.nodered.org/t/error-eacces-permission-denied/32117/2 "2020-08-27T19:43:24Z")

</div>

What OS are you running and how did you install node-red?

Start node-red in a terminal (stop node red then use `node-red-start` if that command exists) and post the resulting output here. Use the `</>` button and paste it in.

Also show use what `ls -l /home/user/.node-red/context` gives, and if that directory does not exist then `ls -l /home/user/.node-red`  
One possibility is that you have been using sudo when you shouldn't and have ended up with files owned by root in your home directory.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [27 August 2020 19:58 UTC](https://discourse.nodered.org/t/error-eacces-permission-denied/32117/3 "2020-08-27T19:58:05Z")

</div>

You have an extra comma creating an invalid object.

> [@Zerg](#):
>
> ```auto
> contextStorage: {
> default: {
> module:"localfilesystem"
> }, <=== there should be no comma here
> },
> 
> ```

The example was

```auto
    contextStorage: {
		storeInFile: { module: "localfilesystem"},
    	default : { module: "memory" }
    },

```

when you removed the `default` line you needed to remove the comma fron the `storeInFile` line so you have

```auto
    contextStorage: {
		storeInFile: { module: "localfilesystem"}
    },

```

This is a simple error that I've made more than once 😁

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [27 August 2020 20:10 UTC](https://discourse.nodered.org/t/error-eacces-permission-denied/32117/4 "2020-08-27T20:10:39Z")

</div>

> [@zenofmud](#):
>
> This is a simple error that I've made more than once

So have I, but I don't think that is what is causing the problem, nodejs seems fairly tolerant of this particular syntax error. Certainly it should be fixed though.

---

<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:** [10 September 2020 20:10 UTC](https://discourse.nodered.org/t/error-eacces-permission-denied/32117/5 "2020-09-10T20:10:43Z")

</div>

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