Installation issues - Permission denied by operating system

Unable to install n8n using npm. facing the below error.

npm WARN deprecated [email protected]: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

Tried running as Administration using sudo and still facing the same error.

Any help would be really helpful

Welcome to the community @balas!

Is sadly not an n8n related issue. Is more specific to your system. So can sadly not be of much help here. You will have probably much more luck if you google the error message "Missing write access to /usr/local/lib/node_modules". You will then find different possible solutions like:

Where they simply suggest to change the owner.

Alternatively you can also install n8n in a folder instead of globally. So something like:

# Create a folder in the home directory
mkdir ~/n8n
# Change to new folder
cd ~/n8n
# Install n8n
npm install n8n

If you then want to start n8n you can run:

~/n8n/node_modules/.bin/n8n

Thanks a lot for the support. (y)

Let me try