How do I set ENV Variables in n8n cloud?

Hi @Bala_Panneerselvam, I am afraid it’s currently not possible to import external Node.js modules in n8n.cloud (as it will always run the “vanilla” version of n8n) or set environment variables.

That said, you can execute any JavaScript code through the Function (or Function Item) node and this would include the Moment.js code. Here’s an example but this includes the really bad eval() method which should always be avoided (so best to see this as a proof of concept rather than a suggestion):

Going forward, you might want to leave a vote at Externally hosted nodes which covers externally hosted code.