Help me solve the problem

Help me solve the problem.
My bot searches for pictures on my local server using AI.
Copies them to a temporary folder. and sends a link back

Error in Create Links Output

{
“errorMessage”: “Unterminated string constant [Line 148]”,
“errorDetails”: {},
“n8nDetails”: {
“n8nVersion”: “1.88.0 (Cloud)”,
“binaryDataMode”: “filesystem”,
“stackTrace”: [
“/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Function:14”,
" const networkPath = tempDir.replace(‘/srv/dev-disk-by-uuid-8e6d16c6-73b1-4728-afa3-d778e2ac2059/shutterstock/temp/’, ‘\\192.168.1.83\shutterstock\temp\’);“,
" ^”,
“”,
“SyntaxError: Unterminated string constant”,
" at makeNiceSyntaxError (/usr/local/lib/node_modules/n8n/node_modules/@n8n/vm2/lib/transformer.js:41:16)“,
" at transformer (/usr/local/lib/node_modules/n8n/node_modules/@n8n/vm2/lib/transformer.js:84:8)”,
" at NodeVM.run (/usr/local/lib/node_modules/n8n/node_modules/@n8n/vm2/lib/nodevm.js:485:17)“,
" at ExecuteContext.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Function/Function.node.js:148:24)”,
" at WorkflowExecute.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:681:50)“,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:915:62”,
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/execution-engine/workflow-execute.js:1246:20"
]
}
}

Hi @Yury_Bl

Just to confirm, are you using n8n Cloud?

yes.
I find a new problem. Files dos’t copy to temp folder

That’s because the backslash character is used to escape special characters. So \' doesn’t mean “backslash character and a ' character terminating the string” but rather a “' character that is a part of the string content”. Backslash character per se requires escaping.

Why do you use backslashes in those constants anyway?

1 Like

Thanks,

According to Execute Command node docs Execute Command | n8n Docs

Not available on Cloud
This node isn’t available on n8n Cloud.

for windows users

Makes sense if you expose the network path to users.
You need to escape each backslash in string constants (prepend with another backslash).