# Using modules Offline

**URL:** <https://discourse.nodered.org/t/using-modules-offline/95946>\
**Category:** General\
**Tags:** function-node\
**Created:** [12 March 2025 13:14 UTC](https://discourse.nodered.org/t/using-modules-offline/95946 "2025-03-12T13:14:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LoRdOfUnO](https://avatars.discourse-cdn.com/v4/letter/l/6bbea6/32.png) [@LoRdOfUnO](https://discourse.nodered.org/u/LoRdOfUnO)\
**Post date:** [12 March 2025 13:14 UTC](https://discourse.nodered.org/t/using-modules-offline/95946/1 "2025-03-12T13:14:27Z")

</div>

Hi All,  
I'm trying to use otpauth [otpauth - npm](https://www.npmjs.com/package/otpauth) inside of Nodered function node using the modules import [Use any npm module in Node-RED • FlowFuse](https://flowfuse.com/blog/2023/06/import-modules/).  
The issue is that the node red doesn't reach internet.  
When deploying I get the error that the connection was closed  
What I do as usual to install offline npm stuff is installing on internet machines and then copy/paste inside of the offline nodered.  
But in this case it seems like even after copy paste, it always try to run npm install command.

Any idea of a fix for that ?

thanks,  
Flo

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [12 March 2025 13:38 UTC](https://discourse.nodered.org/t/using-modules-offline/95946/2 "2025-03-12T13:38:54Z")

</div>

> [@LoRdOfUnO](#):
>
> But in this case it seems like even after copy paste

Copy paste will not update the package json.

It might be better to do it old skool.

add a `require` in your `settings.js`

See `functionGlobalContext` in docs: [Configuration : Node-RED](https://nodered.org/docs/user-guide/runtime/configuration#node-configuration)

---

<div class="post-metadata">

**Author:** ![LoRdOfUnO](https://avatars.discourse-cdn.com/v4/letter/l/6bbea6/32.png) [@LoRdOfUnO](https://discourse.nodered.org/u/LoRdOfUnO)\
**Post date:** [12 March 2025 21:41 UTC](https://discourse.nodered.org/t/using-modules-offline/95946/3 "2025-03-12T21:41:39Z")

</div>

Well tried, it failed to load the settings.js.  
After more googling i find out we may need to run:

```auto
npm i --package-lock-only

```

and it update the package and did the trick !

thanks !

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [10 June 2025 21:42 UTC](https://discourse.nodered.org/t/using-modules-offline/95946/4 "2025-06-10T21:42:37Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
