<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to install NPM packages that n8n App can use?]]></title><description><![CDATA[<p dir="auto">Following a <a href="https://community.n8n.io/t/cannot-import-node-module-cloudinary-vmerror/48476/2?u=vadorequest" target="_blank" rel="noopener noreferrer nofollow ugc">discussion I had on n8n forum</a>, I wonder what are the steps to install a new NPM package so that n8n can access it.</p>
<p dir="auto">It seems to need to be installed globally (<code>-g</code>) but a documented process about how to do that would be good.<br />
Typically, where do I need to do it? Does it work if I do that on the server instance itself? or do I need to do it in some Docker instance for n8n?</p>
<p dir="auto">Having this being documented in <a href="https://www.cloudron.io/store/io.n8n.cloudronapp.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.cloudron.io/store/io.n8n.cloudronapp.html</a> would be a great addition.</p>
]]></description><link>https://forum.cloudron.io/topic/11946/how-to-install-npm-packages-that-n8n-app-can-use</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Mar 2026 12:41:33 GMT</lastBuildDate><atom:link href="https://forum.cloudron.io/topic/11946.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 20 Jun 2024 12:22:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to install NPM packages that n8n App can use? on Fri, 05 Jul 2024 08:05:59 GMT]]></title><description><![CDATA[<p dir="auto">Just for the sake of documenting, here is what I ended up with, in my <code>.env.sh</code> file:</p>
<pre><code># ------------- NODE MODULES ---------------------

# Allow node modules to be used in code node - https://docs.n8n.io/hosting/configuration/#use-built-in-and-external-modules-in-the-code-node
# Allows usage of all builtin modules
export NODE_FUNCTION_ALLOW_BUILTIN=*

# FYI This is a SPACE separated list
export EXTRA_NODE_MODULES="cloudinary@2.2.0 node-fetch@3.1.1"

# Allow usage of external npm modules
# Those modules are auto-installed by Cloudron upon app restart, see https://forum.cloudron.io/topic/11946/how-to-install-npm-packages-that-n8n-app-can-use/4?_=1719382777426
# FYI This is a COMMA separated list
export NODE_FUNCTION_ALLOW_EXTERNAL=cloudinary,node-fetch
</code></pre>
]]></description><link>https://forum.cloudron.io/post/90940</link><guid isPermaLink="true">https://forum.cloudron.io/post/90940</guid><dc:creator><![CDATA[AmbroiseUnly]]></dc:creator><pubDate>Fri, 05 Jul 2024 08:05:59 GMT</pubDate></item><item><title><![CDATA[Reply to How to install NPM packages that n8n App can use? on Fri, 28 Jun 2024 09:37:26 GMT]]></title><description><![CDATA[<p dir="auto">Ahhh, that's what I had missed! Thanks</p>
<p dir="auto">The <a href="http://env.sh" target="_blank" rel="noopener noreferrer nofollow ugc">env.sh</a> file default should definitely mention all of this more in details</p>
<p dir="auto">And I'd suggest to enable built in (fs, etc.) by default, that's clearly not a security issue, and most of the people would want to use those. But that's a different topic.</p>
]]></description><link>https://forum.cloudron.io/post/90531</link><guid isPermaLink="true">https://forum.cloudron.io/post/90531</guid><dc:creator><![CDATA[AmbroiseUnly]]></dc:creator><pubDate>Fri, 28 Jun 2024 09:37:26 GMT</pubDate></item><item><title><![CDATA[Reply to How to install NPM packages that n8n App can use? on Fri, 28 Jun 2024 05:52:07 GMT]]></title><description><![CDATA[<p dir="auto">You have to install the modules via the <code>EXTRA_NODE_MODULES</code> variable - <a href="https://docs.cloudron.io/apps/n8n/#custom-node-modules" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.cloudron.io/apps/n8n/#custom-node-modules</a> . Then, those are whitelisted using <code>NODE_FUNCTION_ALLOW_EXTERNAL</code></p>
]]></description><link>https://forum.cloudron.io/post/90515</link><guid isPermaLink="true">https://forum.cloudron.io/post/90515</guid><dc:creator><![CDATA[girish]]></dc:creator><pubDate>Fri, 28 Jun 2024 05:52:07 GMT</pubDate></item><item><title><![CDATA[Reply to How to install NPM packages that n8n App can use? on Wed, 26 Jun 2024 08:18:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nebulon" aria-label="Profile: nebulon">@<bdi>nebulon</bdi></a> How does one checks that a specified node module is installed?</p>
<p dir="auto">I'm asking because despite having added <code>cloudinary</code> and restarted the n8n app, I'm still facing the same issue</p>
<pre><code class="language-sh"># https://docs.n8n.io/reference/environment-variables.html
export EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=true
export EXECUTIONS_DATA_SAVE_ON_ERROR=all
export EXECUTIONS_DATA_SAVE_ON_SUCCESS=all
export N8N_LOG_LEVEL=info

export EXECUTIONS_DATA_PRUNE=true
export EXECUTIONS_DATA_MAX_AGE=672

# Allow node modules to be used in code node - https://docs.n8n.io/hosting/configuration/#use-built-in-and-external-modules-in-the-code-node
# Allows usage of all builtin modules
export NODE_FUNCTION_ALLOW_BUILTIN=*

# Allow usage of external npm modules
# Those modules are auto-installed by Cloudron upon app restart, see https://forum.cloudron.io/topic/11946/how-to-install-npm-packages-that-n8n-app-can-use/4?_=1719382777426
export NODE_FUNCTION_ALLOW_EXTERNAL=cloudinary@2.2.0
</code></pre>
<p dir="auto">Getting:</p>
<pre><code>VMError: Cannot find module 'cloudinary' at LegacyResolver.resolveFull (/app/code/node_modules/@n8n/vm2/lib/resolver.js:126:9) at LegacyResolver.resolveFull (/app/code/node_modules/@n8n/vm2/lib/resolver.js:316:16) at LegacyResolver.resolveFull (/app/code/node_modules/@n8n/vm2/lib/resolver-compat.js:147:17) at LegacyResolver.resolve (/app/code/node_modules/@n8n/vm2/lib/resolver.js:121:15) at resolve (/app/code/node_modules/@n8n/vm2/lib/nodevm.js:317:21) at VM2 Wrapper.apply (/app/code/node_modules/@n8n/vm2/lib/bridge.js:485:11) at requireImpl (/app/code/node_modules/@n8n/vm2/lib/setup-node-sandbox.js:90:19) at require (/app/code/node_modules/@n8n/vm2/lib/setup-node-sandbox.js:171:10) at /app/code/node_modules/n8n-nodes-base/dist/nodes/Code:1:117 at /app/code/node_modules/n8n-nodes-base/dist/nodes/Code:43:2

</code></pre>
<p dir="auto"><img src="/assets/uploads/files/1719389862312-47d003e7-5cf3-4ed6-a27d-07be41fe60b8-image.png" alt="image.png" class=" img-fluid img-markdown" /></p>
]]></description><link>https://forum.cloudron.io/post/90401</link><guid isPermaLink="true">https://forum.cloudron.io/post/90401</guid><dc:creator><![CDATA[AmbroiseUnly]]></dc:creator><pubDate>Wed, 26 Jun 2024 08:18:03 GMT</pubDate></item><item><title><![CDATA[Reply to How to install NPM packages that n8n App can use? on Sat, 22 Jun 2024 22:42:31 GMT]]></title><description><![CDATA[<p dir="auto">Okay, hence the best practice of specifying the module's version, otherwise the major version might change upon any app restart.</p>
]]></description><link>https://forum.cloudron.io/post/90254</link><guid isPermaLink="true">https://forum.cloudron.io/post/90254</guid><dc:creator><![CDATA[AmbroiseUnly]]></dc:creator><pubDate>Sat, 22 Jun 2024 22:42:31 GMT</pubDate></item><item><title><![CDATA[Reply to How to install NPM packages that n8n App can use? on Fri, 21 Jun 2024 13:10:49 GMT]]></title><description><![CDATA[<p dir="auto">We will mention it in the docs, but yes on app restart the specified node modules (from <code>EXTRA_NODE_MODULES</code>) will get installed automatically: <a href="https://git.cloudron.io/cloudron/n8n-app/-/blob/master/start.sh?ref_type=heads#L51" target="_blank" rel="noopener noreferrer nofollow ugc">https://git.cloudron.io/cloudron/n8n-app/-/blob/master/start.sh?ref_type=heads#L51</a></p>
]]></description><link>https://forum.cloudron.io/post/90193</link><guid isPermaLink="true">https://forum.cloudron.io/post/90193</guid><dc:creator><![CDATA[nebulon]]></dc:creator><pubDate>Fri, 21 Jun 2024 13:10:49 GMT</pubDate></item><item><title><![CDATA[Reply to How to install NPM packages that n8n App can use? on Fri, 21 Jun 2024 10:12:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/nebulon" aria-label="Profile: nebulon">@<bdi>nebulon</bdi></a> Yes, I had read those. I'm confused about whether those NPM packages need to be installed (in addition to changing the config file), and if so, how. I believe the documentation might be missing a key step, or maybe the installation of those packages is being done under the wheel, but I very much doubt so.</p>
<p dir="auto">Here is a video that might explain better my issue:<br />
<a href="https://www.loom.com/share/801e7f5745974be4b9676478053f7ff4" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.loom.com/share/801e7f5745974be4b9676478053f7ff4</a></p>
]]></description><link>https://forum.cloudron.io/post/90180</link><guid isPermaLink="true">https://forum.cloudron.io/post/90180</guid><dc:creator><![CDATA[AmbroiseUnly]]></dc:creator><pubDate>Fri, 21 Jun 2024 10:12:34 GMT</pubDate></item><item><title><![CDATA[Reply to How to install NPM packages that n8n App can use? on Thu, 20 Jun 2024 13:09:36 GMT]]></title><description><![CDATA[<p dir="auto">Have you seen <a href="https://docs.cloudron.io/apps/n8n/" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.cloudron.io/apps/n8n/</a> already?</p>
]]></description><link>https://forum.cloudron.io/post/90142</link><guid isPermaLink="true">https://forum.cloudron.io/post/90142</guid><dc:creator><![CDATA[nebulon]]></dc:creator><pubDate>Thu, 20 Jun 2024 13:09:36 GMT</pubDate></item></channel></rss>