“The specified package could not be loaded” when using n8n community nodes

Updated 15 hours ago

After restarting n8n, users may see an error message when loading certain community nodes (for example, n8n-nodes-hostinger-api).
This issue usually happens when leftover files in the n8n node directory prevent modules from being reloaded correctly.

You might see this error message in the n8n logs or dashboard:

Error loading package "n8n-nodes-hostinger-api": The specified package could not be loaded. Cause: Class could not be found. Please check if the class is named correctly.

Root Cause

This happens when stale dependencies (for example, package.json or node_modules) remain inside /home/node/.n8n/nodes after a reinstall or node update.
These leftover files can prevent n8n from properly loading community node classes.

Solution

You can fix the issue with a single command.

  1. Run this command:

    docker exec -it root-n8n-1 sh -c "cd /home/node/.n8n/nodes && rm -rf package.json node_modules"
  2. Restart the container:

    docker restart root-n8n-1
  3. Reinstall the desired node (for example, n8n-nodes-hostinger-api) from the n8n UI or CLI.

Additional Notes

  • The issue can also occur after uninstalling or updating other nodes (for example, n8n-nodes-puppeteer).

  • Always restart n8n after modifying anything in /home/node/.n8n/nodes.

  • Removing the package.json and node_modules ensures n8n rebuilds dependencies from scratch.