EACCES: permission denied, mkdir '/usr/local/lib/node_modules/n8n'

Hi,
I am facing an error while installing n8n globally on mac using my VS CODE terminal
Does anyone know how to fix this issue?

Command: Npm install n8n -g

Error Encountered:

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/n8n/node_modules/n8n-nodes-base
npm WARN n8n-nodes-base@“1.41.1” from [email protected]
npm WARN node_modules/n8n
npm WARN n8n@“*” from the root project
npm WARN 1 more (@n8n/n8n-nodes-langchain)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer n8n-nodes-base@“1.41.0” from [email protected]
npm WARN node_modules/n8n/node_modules/n8n-core
npm WARN n8n-core@“1.41.0” from [email protected]
npm WARN node_modules/n8n
npm WARN
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/n8n-nodes-base
npm WARN peer n8n-nodes-base@“1.41.0” from [email protected]
npm WARN node_modules/n8n/node_modules/n8n-core
npm WARN n8n-core@“1.41.0” from [email protected]
npm WARN node_modules/n8n
npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/n8n
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/n8n’
npm ERR! [Error: EACCES: permission denied, mkdir ‘/usr/local/lib/node_modules/n8n’] {
npm ERR! errno: -13,
npm ERR! code: ‘EACCES’,
npm ERR! syscall: ‘mkdir’,
npm ERR! path: ‘/usr/local/lib/node_modules/n8n’
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.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Operating System : Mac
Running Via: VS CODE

This sounds like you do not have write permissions to /usr/local/lib/.
You could try running the command with sudo, or try running n8n via docker instead (recommended).

1 Like

Thanks, another question.

How can we use SSL certificates in our HTTP node.

Replied here.
But, please don’t ask the same question in multiple places. It creates additional work for us :pray:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.