// guides · n8n error index

n8n Execute Command and Read/Write Files errors: 61 real runs, fixed

Fix the n8n Execute Command node missing (Unrecognized node type), commands that run once for all items or break on quotes, and Read/Write Files from Disk failing with 'Access to the file is not allowed.' or returning 0 items. 61 real runs on n8n 2.43.7.

Updated 2026-10-23 · about 10 minutes

Still stuck after these steps? Paste your exact n8n error and we'll reproduce it and email you the fix, free →

Steps

  1. Execute Command missing? Remove it from NODES_EXCLUDE

    n8n 2.x turns off the Execute Command and Local File Trigger nodes by default. With default settings, our imported workflow failed before running with Unrecognized node type: n8n-nodes-base.executeCommand, and the node doesn't show up in the editor. Start n8n with NODES_EXCLUDE='[]' (or a list that leaves out n8n-nodes-base.executeCommand) and restart it. In Docker, set it as an environment variable on the container.

  2. A failing command shows only its stderr

    When the command exits with a non-zero code, the node fails and the message is just what the command printed to stderr, for example ls: cannot access '/nope': No such file or directory, with no exit code. Text on stderr alone doesn't fail the node: echo warn 1>&2; echo out succeeded with both fields filled. To keep going after a failure, add || true, end with ; echo "exit=$?", or set the node's On Error setting to continue.

  3. It runs once, not once per item

    With 3 input items, Execute Command (version 1) ran a single time and output 1 item, with or without Execute Once. If you need one run per item, put it inside Loop Over Items, or build a single command that handles all the values.

  4. Quote values from expressions, and avoid apostrophes

    Expressions are pasted into the command as plain text and run by /bin/sh, not bash. A filename a b.txt became two arguments (wc -w said 2). A value with an apostrophe inside single quotes broke the command: /bin/sh: 1: Syntax error: Unterminated quoted string. Wrap values in double quotes, replace ' first in a Set or Code node, or write the value to a file and read it from the command.

  5. Know where the command runs

    The working directory was the folder n8n was started from, and $HOME was the OS user's home, not N8N_USER_FOLDER. Environment variables come from the n8n process: $MYSECRET was empty until n8n itself was started with it. Programs must exist where n8n runs (inside the container in Docker). The output is text: echo '{"a":1}' gave the string {"a":1}, so parse it with JSON.parse in a Code node.

  6. 'Access to the file is not allowed.'? Check the allowed folder

    Read/Write Files from Disk only works inside N8N_RESTRICT_FILE_ACCESS_TO, which defaults to ~/.n8n-files. The ~ means the OS user's home folder, not N8N_USER_FOLDER: a file inside our n8n user folder's .n8n-files was refused with Access to the file is not allowed. until HOME pointed to the same folder. In the official Docker image that folder is /home/node/.n8n-files. To allow other folders, set N8N_RESTRICT_FILE_ACCESS_TO to absolute paths separated by ; and restart; reads and writes outside it fail with the same message.

  7. 0 items and no error? Use an absolute path, and create folders first

    A file that doesn't exist, a relative path like a.txt and a path starting with ~/ all succeeded with 0 items and no error, so the next node silently didn't run (see next node not running). Use full absolute paths; globs like /home/node/.n8n-files/*.txt work and return one item per file. When writing, the input must carry a binary field (use Convert to File first), and the target folder must already exist: n8n won't create it and fails with The file or directory does not exist.

What we ran

On 23 October 2026 we ran 61 executions of 24 small workflows with n8n execute on n8n 2.43.7 (Execute Command node version 1, Read/Write Files from Disk node version 1), as a normal Linux user, in four setups: default settings, NODES_EXCLUDE='[]', HOME set to N8N_USER_FOLDER, and a custom N8N_RESTRICT_FILE_ACCESS_TO list. Every message below is copied from those runs.

SetupResult
Execute Command node, default n8n 2.43.7 settingsWorkflow fails before running: Unrecognized node type: n8n-nodes-base.executeCommand
Same workflow after starting n8n with NODES_EXCLUDE='[]'Runs
echo hello1 item: exitCode 0, stderr empty, stdout hello
ls /nope (exit code 2)Node error, the message is just the stderr text: ls: cannot access '/nope': No such file or directory
echo warn 1>&2; echo out (exit 0, something on stderr)Success: stderr warn, stdout out
3 input items, Execute Command v1Ran once and output 1 item (same with Execute Once on)
echo {{ $json.f }} | wc -w with f = a b.txtstdout 2: the value is pasted unquoted, so the space splits it
echo '{{ $json.t }}' with t = it's/bin/sh: 1: Syntax error: Unterminated quoted string
pwd; echo $HOMEWorking directory = the folder n8n was started from; HOME = the OS user's home, not N8N_USER_FOLDER
echo $MYSECRET, n8n started without it / with MYSECRET=abcEmpty / abc: the command inherits n8n's own environment
sleep 3; echo doneWaited 3 seconds, then done
python3 -c 'print(1+1)'2 (the program must exist where n8n runs, or in its container)
echo '{"a":1}'stdout is the text {"a":1}, not a JSON object
Read Files from Disk, file in N8N_USER_FOLDER/.n8n-files, HOME is a different folderAccess to the file is not allowed.
Same file after starting n8n with HOME = N8N_USER_FOLDERRead fine
Read a file outside the allowed folder (/tmp/…/files/a.txt)Access to the file is not allowed.
Write a file outside the allowed folderAccess to the file is not allowed.
N8N_RESTRICT_FILE_ACCESS_TO set to two folders separated by ;Reads and writes in both folders worked
Glob /…/.n8n-files/*.txtOne item per file, each with binary property data
Path to a file that doesn't existSuccess, 0 items, no error
Relative path a.txtSuccess, 0 items, no error
Path starting with ~/.n8n-files/Success, 0 items, no error (~ is not expanded in the path)
Write Files with no binary inputThis operation expects the node's input data to contain a binary file 'data', but none was found [item 0]
Write into a subfolder that doesn't existThe file or directory does not exist (ENOENT: no such file or directory, realpath)
Write with Append onFile appended (2 bytes became 4)

Good to know

What we didn't test

FAQ

Why is the Execute Command node missing in n8n?

n8n 2.x excludes it by default. Imported workflows fail with Unrecognized node type: n8n-nodes-base.executeCommand. Set NODES_EXCLUDE='[]' (or a list without it) and restart n8n.

Why does n8n say Access to the file is not allowed?

The path is outside N8N_RESTRICT_FILE_ACCESS_TO, which defaults to ~/.n8n-files in the OS user's home (/home/node/.n8n-files in Docker), not in N8N_USER_FOLDER. Move the file there or add its folder to that variable, separated by ;.

Why does Read Files from Disk return no items?

In our tests a missing file, a relative path and a path starting with ~ all returned 0 items with no error. Use an absolute path.

Why does Execute Command only run once for several items?

Version 1 of the node ran once for 3 input items. Use Loop Over Items to run it per item.

How do I get the exit code of a command in n8n?

A non-zero exit fails the node with only the stderr text. Append ; echo "exit=$?" to the command, or set On Error to continue.

Related guides

New guides

Still stuck on your n8n error?

Paste the exact error and say what the workflow should do. We reproduce it on a real n8n install and email you the fix or a working workflow, usually within 24h. Free while we're in beta.

We'll only email you about your error and TaskToAgent.