after being away for a while, I updated the selfhosted ai kit by pulling the latest n8n image. Now I can’t anymore install community modules through the n8n gui. any idea how to fix this?
this worked a couple of weeks ago.
I understand that this was an error in earlier versions of n8n. But I am running 1.105.4 which should have fixed this a long time ago?
What is the error message (if any)?
I get errors like this: Error installing new package Error loading package “n8n-nodes-microsoft-sharepoint” :Cannot set properties of undefined (setting ‘n8n-nodes-microsoft-sharepoint’)
I know it worked in previous versions of n8n, since I installed and used community packages. I can’t tell you what version I had when I installed those packages, though.
Now I have 1.105.4 and I can’t install community packages anymore through the GUI.
I am running the n8n-ai-kit with docker and in docker-compose.xaml, the necessary flags for community packages are set. Otherwise I would not have to be able to use community packages before.
On the following articles, it is said that an update was fixing the problem. That was around version 1.94.1
I have just tested installing n8n-nodes-paperless-ngx on a clean 1.106.0 docker image and they appear to be working as expected, I suspect there may be something environmental going on here.
Hey all I was having this error for a while and I finally sat down and fixed it.
Here’s how I fixed the “Error loading package … Cannot set properties of undefined (setting ‘n8n-nodes-XXXX’)” issue for me on a self-hosted/Docker setup when installing community nodes via the UI.
Symptom
Installing a package (e.g., n8n-nodes-serpapi, n8n-nodes-firecrawl) from Settings → Community Nodes fails with:
Error loading package "n8n-nodes-<name>" :Cannot set properties of undefined (setting 'n8n-nodes-<name>')
Logs show something like:
CommunityPackagesController.installPackage ... Cannot set properties of undefined (setting 'n8n-nodes-serpapi')
Root cause (in my case)
My community nodes workspace file /home/node/.n8n/nodes/package.json existed but didn’t have a dependencies field. The UI tries to write pkgJson.dependencies["package-name"] = "version" and crashes if dependencies is undefined.
Quick fix (run inside your n8n container)
# 1) Inspect your package.json
cat /home/node/.n8n/nodes/package.json
# If it looks like this (no "dependencies"), this fix may help:
# {
# "name": "nodes",
# "version": "1.0.0",
# "description": "",
# "main": "index.js",
# "scripts": { "test": "echo \"Error: no test specified\" && exit 1" },
# "keywords": [],
# "author": "",
# "license": "ISC"
# }
# 2) Patch it to add "private": true and an empty "dependencies" object
node -e 'const fs=require("fs");const p="/home/node/.n8n/nodes/package.json";const j=JSON.parse(fs.readFileSync(p,"utf8"));j.private=true;j.dependencies=j.dependencies||{};fs.writeFileSync(p,JSON.stringify(j,null,2));console.log("patched:",p)'
# 3) Ensure permissions are sane for the node user
chown -R node:node /home/node/.n8n
chmod 775 /home/node/.n8n /home/node/.n8n/nodes
# 4) (Optional but recommended) Make sure the community packages registry file exists
[ -f /home/node/.n8n/community-packages.json ] || printf '{ "installed": {} }\n' > /home/node/.n8n/community-packages.json
chmod 664 /home/node/.n8n/community-packages.json
chown node:node /home/node/.n8n/community-packages.json
# 5) Restart n8n
exit
docker restart <your-n8n-container-id-or-name>
Environment flags to double-check
N8N_COMMUNITY_PACKAGES_ENABLED=true
After this, I could install community nodes from the UI just fine:
n8n-nodes-serpapi
n8n-nodes-firecrawl
Notes
If you run separate main + worker containers, make sure both mount the same/home/node/.n8n volume so workers can execute the newly installed nodes.
If you still get the error after the patch, tail logs while clicking “Install” and confirm:
/home/node/.n8n/nodes/package.json now contains "dependencies": {} (or the installed package after a successful attempt).
/home/node/.n8n/community-packages.json exists and is valid JSON with an "installed" object.
I encountered a similar error when installing a community node, but it was a little different. The error was as follows:Error installing new package
Error loading package “n8n-nodes-comfyui-media” :The community nodes service is temporarily unreachable. Please try again later. What should I do? Thanks for your reply. Version 1.112.6