Is it possible to use the NPM packet offline in node-red? with node-red-contrib-function-npm

Hello I am new here, I am a designer and not a programmer. My wlan network is offline.

node-red-contrib-npm / node-red-contrib-function-npm at the start, npm packet always download from the internet into a temp folder. I have installed the package for all computer user but node-red does not access them.

Is it possible to use the NPM packet offline in node-red?
So I can use the packages via CMD, but not via node-red.

thanks

I don't use those nodes and you don't really need to since you can simply use the exec node and run npm that way.

I doubt that those nodes support offline unless they are documented as doing so. Since contributed nodes are supported by the authors, you would need to raise an issue on GitHub to discuss it with them if they don't respond here. The sidebar on the flows site or npm site for those nodes should have a link back to GitHub.

If you have installed the nodes with npm -g install to make them global, then Node-RED should, I think, still pick them up. It may help if you update the package.json file for each user to include the list of packages.

In general, the use of global installs is discouraged as it not only creates potential security holes but may also cause permissions issues.

You should note that, because nodes are just npm packages, you can copy the package's folder from a device that is able to contact the Internet as long as that device is running the same version of Node.js/npm and is the same platform type. As already mentioned, if you do this, then you also should update the package.json file accordingly.

1 Like

Thank you for your help. I understand now slowly how Node Red works or on other Node.js tools. package.json pointing the way helped me a lot.

I found this.
https://nodered.org/docs/user-guide/writing-functions#loading-additional-modules

1 Like