We are currently working on a project that utilizes n8n, and we need to implement data encryption using the aes-256-gcm algorithm. To achieve this, we would like to use the built-in Node.js crypto library, but we have noticed that it is not available in n8n’s code nodes.
We understand that some Node.js libraries may require activation or specific configurations to be used within n8n workflows. Could you provide guidance on whether there is a way to enable the crypto library for code nodes?
I was reading the n8n documentation and came across this section:
“If you use n8n Cloud, you can’t import external npm modules. However, n8n makes two modules available for you:”
crypto (Node.js module)
moment (npm package)
What is the error message (if any)?
“Cannot find module ‘crypto’ or its corresponding type declarations.”
The Red error squiggly line doesn’t matter for external modules, the code node doesn’t have full access to all of the modules from the front end so it thinks there is an issue but as long as the node runs then you execute it all is good.
In the future we plan to remove the check in the editor for external modules which will resolve the ui issue.