ERROR: Access denied to require 'child_process'

Hi n8n.io Community

I am a newbie to the n8n.io and assigned a task to automate a template where git clones the repository and pushes the changes to the new repository automatically.
I am stuck at n8n functions where I am using the following JavaScript code

const{ execSync } = require('child_process');

execSync('git clone https://gitlab.com/grey-software/automation.git','cd automation','git add .','git commit -m "Adding Grey Docs"','git remote add origin [email protected]:grey-software/private-automation-testing.git','git push -u origin master', {
  stdio: [0, 1, 2], 
  })

Getting following Error

ERROR: Access denied to require ‘child_process’

VMError: Access denied to require 'child_process'
    at _require (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/sandbox.js:289:25)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes:1:118
    at Object.<anonymous> (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes:6:2)
    at NodeVM.run (/usr/local/lib/node_modules/n8n/node_modules/vm2/lib/main.js:1121:29)
    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/n8n-nodes-base/dist/nodes/Function.node.js:65:31)
    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/src/Workflow.js:492:37)
    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/src/WorkflowExecute.js:395:62

Hey @adilshehzad786!

Welcome to the community :slightly_smiling_face:

This post might be helpful: [HELP] Not been able to import external modules - #8 by jan