Automate NPM package installation and updates for self hosted en
Are you looking to install external libraries for your self-hosted N8N instance? This automated workflow makes adding npm packages to your N8N environment qu...
🔌 Nodes & Integrations Used (2)
📖 Implementation & Setup Guide
*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.** ## What This Workflow Does 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. ### Key features
✅ **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.
How to install and update external libraries automatically ### Step 1: Setting Up Your Environment Variables Before using external libraries in N8N Code nodes, configure these environment variables in your Docker comppose file. #### Option A to allow specific external npm packages in N8N Code nodes ``` NODE_FUNCTION_ALLOW_EXTERNAL=axios,cheerio,node-fetch ``` #### Option B to allow all external npm packages in Code nodes ``` NODE_FUNCTION_ALLOW_EXTERNAL=* ```
Step 2: Import the external packages workflow
Import the workflow into your N8N instance by copy pasting all nodes.
Step 3: Input the list of external libraries you need
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
Step 4: Start the workflow! Run the workflow manually or let it trigger automatically
Why use this to install NPM packages in N8N? 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.
⚡ How to import this workflow into n8n:
- Click the Direct Download JSON button above to save
Automate_NPM_package_installation_and_updates_for_self_hosted_en.json. - Log in to your n8n Cloud or self-hosted n8n instance.
- In your workflow canvas, click the menu in top-right and select Import from File (or paste the JSON directly).
- Configure your credentials (e.g. API keys, database URLs) in the corresponding node settings.
- Click Execute Workflow to test and switch to Active!
Related General Automation Workflows
View All in General Automation →Generate Application Copy
Production-ready n8n automation template for Generate Application Copy built by AhiXLight. Seamlessly connects Execute Workflow Trigger, OpenAI with 4 configured nodes.
2-way sync Google Contacts and Notion
Sync your Google Contacts with your Notion database. You can filter contacts by label or sync all contacts. All contact information is kept in sync between G...
2D Image to 3D Model Automation
Production-ready n8n automation template for 2D Image to 3D Model Automation built by AhiXLight. Seamlessly connects HTTP Request, Google Sheets, Google Drive with 17 configured nodes.
2 way sync assignments completion between Canvas LMS and Notion
Syncs assignments and completion states to and fro between Canvas LMS and a Notion database. Automatically triggers every 2 hours during the schoolday by def...