Describe the problem/error/question

I am trying to update n8n self-hosted via npm. Running npm update -g n8n gives me this;

npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @n8n/typeorm@0.3.20-12
npm warn Found: @sentry/node@9.46.0
npm warn node_modules/n8n/node_modules/@sentry/node
npm warn   @sentry/node@"^9.42.1" from n8n@1.107.4
npm warn   node_modules/n8n
npm warn     n8n@"*" from the root project
npm warn   3 more (n8n-core, @n8n/task-runner, @sentry/node-native)
npm warn
npm warn Could not resolve dependency:
npm warn peerOptional @sentry/node@"<=8.x" from @n8n/typeorm@0.3.20-12
npm warn node_modules/n8n/node_modules/@n8n/typeorm
npm warn   @n8n/typeorm@"0.3.20-12" from n8n@1.107.4
npm warn   node_modules/n8n
npm warn   3 more (@n8n/backend-test-utils, @n8n/db, @n8n/n8n-nodes-langchain)
npm warn
npm warn Conflicting peer dependency: @sentry/node@8.55.0
npm warn node_modules/@sentry/node
npm warn   peerOptional @sentry/node@"<=8.x" from @n8n/typeorm@0.3.20-12
npm warn   node_modules/n8n/node_modules/@n8n/typeorm
npm warn     @n8n/typeorm@"0.3.20-12" from n8n@1.107.4
npm warn     node_modules/n8n
npm warn     3 more (@n8n/backend-test-utils, @n8n/db, @n8n/n8n-nodes-langchain)
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @browserbasehq/stagehand@1.14.0
npm warn Found: openai@5.8.1
npm warn node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/openai
npm warn   openai@"5.8.1" from @n8n/n8n-nodes-langchain@1.106.2
npm warn   node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain
npm warn     @n8n/n8n-nodes-langchain@"1.106.2" from n8n@1.107.4
npm warn     node_modules/n8n
npm warn   1 more (@langchain/community)
npm warn
npm warn Could not resolve dependency:
npm warn peer openai@"^4.62.1" from @browserbasehq/stagehand@1.14.0
npm warn node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/@browserbasehq/stagehand
npm warn   peer @browserbasehq/stagehand@"^1.0.0" from @langchain/community@0.3.47
npm warn   node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/@langchain/community
npm warn
npm warn Conflicting peer dependency: openai@4.104.0
npm warn node_modules/openai
npm warn   peer openai@"^4.62.1" from @browserbasehq/stagehand@1.14.0
npm warn   node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/@browserbasehq/stagehand
npm warn     peer @browserbasehq/stagehand@"^1.0.0" from @langchain/community@0.3.47
npm warn     node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/@langchain/community
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: @langchain/community@0.3.47
npm warn Found: mongodb@6.11.0
npm warn node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/mongodb
npm warn   mongodb@"6.11.0" from @n8n/n8n-nodes-langchain@1.106.2
npm warn   node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain
npm warn     @n8n/n8n-nodes-langchain@"1.106.2" from n8n@1.107.4
npm warn     node_modules/n8n
npm warn
npm warn Could not resolve dependency:
npm warn peerOptional mongodb@"^6.17.0" from @langchain/community@0.3.47
npm warn node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/@langchain/community
npm warn   @langchain/community@"0.3.47" from @n8n/n8n-nodes-langchain@1.106.2
npm warn   node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain
npm warn
npm warn Conflicting peer dependency: mongodb@6.18.0
npm warn node_modules/mongodb
npm warn   peerOptional mongodb@"^6.17.0" from @langchain/community@0.3.47
npm warn   node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/node_modules/@langchain/community
npm warn     @langchain/community@"0.3.47" from @n8n/n8n-nodes-langchain@1.106.2
npm warn     node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain
removed 34 packages, and changed 2 packages in 12s
244 packages are looking for funding
  run `npm fund` for details

After the above, still stuck on 1.105.3. I tried all kinds of things like running the install command, uninstalling and reinstalling, nothing appears to work.

What is the error message (if any)?

Please share your workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 1.105.3
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): npm
  • Operating system: Ubuntu 22.04
  • Managed to get it updated by completely uninstalling and removing all traces of n8n from the system. Reinstalled it and confirmed that it is now on latest.

    New issue now, getting the below when navigating to :5678;

    Cannot GET /

    The culprit was this log;

    Error: Cannot find module ‘ajv/dist/core’

    Complete reinstall again and managed to get it back up and running again.

    There HAS to be a better way to handle updates…

    Guys, I was having the same problem.
    I think it was stemming from the npm running the wrong/old version existing in my system for some reason.
    I asked it to one of the LLMs, and it said:

    1. Use npx

    The most straightforward method is to prefix your command with npx. This tool automatically finds and runs the command from your project’s local node_modules directory.

    npx n8n start
    

    This is the recommended way to run locally installed packages without having to worry about your system’s PATH.

    which seems to work for me!