@Kaviya_V How did you deploy n8n? If using Docker, you have to add a mount and give the container access to D:\N8n\files. Make sure to give the container permissions on this directory(sudo chown -R 1000:1000 /host/path on Linux), otherwise it will also fail with the same error.
Hi, i Insatlled the n8n locally hosted not from docker
I canāt say whatās the issue in that case. But generally speaking, the npm release is not stable and I donāt recommend using it for production. You would want to move to Docker eventually in the future.
Hi @Kaviya_V Welcome!
I guess you should try giving explicit permissions to that path if that works via env variable which is N8N_RESTRICT_FILE_ACCESS_TO which you can setup in windows using set command before running n8n, although i would not agree on NPM version of n8n is not being stable as i am using that only for past 8 months and never faced any issue. Try reading this thread for more information about similar errors:
hi, i set env variable as per you mentioned and n8n start from powershell, it is working but if i closed powershell command prompt, it is again start throws same error. should i keep on open powershell cmd?
Hi @Kaviya_V Glad it worked, it is a limitation of those env variables that once the session is closed those values would also be gone although you could go inside CMD configs and permanently edit those but i do not recommend that because those values can sometimes change, so for now the best fix is to install n8n via docker and then edit those in its configs that would always be saved and would be up, just in case if you do not want docker and want NPM like me what i did was:
currently you have used set command but now use setx command that would save everything permanently like setx ENV_NAME=VALUE
Just in case if you want docker:
currently you have used set command but now use setx command that would save everything permanently like setx ENV_NAME=VALUE- could you please clearly say?
I mean here you previously might have used this:
set N8N_RESTRICT_FILE_ACCESS_TO=/some/file/path
and as you have confirmed this worked, now i want you to try using this:
setx N8N_RESTRICT_FILE_ACCESS_TO=/some/file/path
And that should permanently save that path so that no matter which session you open this env variable would always be saved across all sessions of CMD and you do not have to re declare again and again when starting n8n via npm command.
sorry, i have used enviroment variable application property for set the path as per screenshot mentioned in forum, So could you please say where should i execute setx N8N_RESTRICT_FILE_ACCESS_TO=/some/file/path? Power shell or command prompt?
@Kaviya_V You have to use that command before starting n8n in the COMMAND PROMPT not in power shell. (in the same shell for first run and then test does it work in different sessions or not)
Hi, i put this commmand in nssm and restart the n8n after that it is working fine. Thanks a lot.
Hey @Kaviya_V Glad it worked to appreciate my help consider marking that as a solution to let otherās know what is right.
Cheers! Have a nice weekend!


