Are you looking to install external libraries for your self-hosted N8N instance? This automated workflow makes adding npm packages to your N8N environment quick and effortless.
Beware, this workflow only works on self-hosted instances.
This solution automatically installs npm packages like axios, cheerio, or node-fetch in your self-hosted N8N Docker container, making them immediately available in Code nodes.
✅ Automated Installation: No manual npm commands needed
✅ Daily Updates: Scheduled trigger keeps packages current
✅ Smart Installation: Only installs missing packages
✅ Multiple Triggers: Manual, scheduled, and on startup of the N8N instance so you can upgrade your N8N version without worrying about external libraries.
Before using external libraries in N8N Code nodes, configure these environment variables in your Docker comppose file.
NODE_FUNCTION_ALLOW_EXTERNAL=axios,cheerio,node-fetch
NODE_FUNCTION_ALLOW_EXTERNAL=*
Import the workflow into your N8N instance by copy pasting all nodes.
Edit the libraries_set node
Change the comma-separated list (e.g., axios,cheerio,node-fetch).
If you chose Option A above, update your NODE_FUNCTION_ALLOW_EXTERNAL variable with the same packages
Run the workflow manually or let it trigger automatically
Managing external packages manually in N8N can be time-consuming. This workflow automates the entire process, making sure your libraries are always installed and up-to-date.