# ERROR: Cannot find module 'crypto' \[line 1\]

**URL:** <https://community.n8n.io/t/error-cannot-find-module-crypto-line-1/25179>\
**Category:** Questions\
**Tags:** node\
**Created:** [April 14, 2023, 9:10am UTC](https://community.n8n.io/t/error-cannot-find-module-crypto-line-1/25179 "2023-04-14T09:10:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandeep\_Mallareddy](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sandeep_mallareddy/32/12739_2.png) [@Sandeep\_Mallareddy](https://community.n8n.io/u/Sandeep_Mallareddy)\
**Post date:** [April 14, 2023, 9:10am UTC](https://community.n8n.io/t/error-cannot-find-module-crypto-line-1/25179/1 "2023-04-14T09:10:37Z")

</div>

Hi everyone,

I am a newbie to n8n. I am trying to create a UUID and trying to import the crypto module. But it throws the error “Cannot find module ‘crypto’ [line 1]”.

I am running a self-hosted n8n Docker image. Everything else works great except for this error  
I have included “NODE\_FUNCTION\_ALLOW\_EXTERNAL=crypto” in my .env file and restarted my docker to no avail.

Am I missing something? Thank you for your patience

## Trying to use the Crypto Module in the Code Node

## What is the error message (if any)?

ERROR: Cannot find module ‘crypto’ [line 1]

## Please share your workflow

```auto
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)

```

## Share the output returned by the last node

## Information on your n8n setup

- \*\*n8n version:_0.222.2_
- \*\*Database (default: SQLite): _SQLITE_
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- \*\*Running n8n via (Docker, npm, n8n cloud, desktop app):_Docker_
- \*\*Operating system:_Ubuntu 20.04_

---

<div class="post-metadata">

**Author:** ![EmeraldHerald](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/emeraldherald/32/35355_2.png) [@EmeraldHerald](https://community.n8n.io/u/EmeraldHerald)\
**Post date:** [April 14, 2023, 9:58am UTC](https://community.n8n.io/t/error-cannot-find-module-crypto-line-1/25179/2 "2023-04-14T09:58:19Z")

</div>

Hi @Sandeep_Mallareddy - welcome to the community 🍰

You might not need the code node for this - can you generate the UUID in the crypto node, instead? It has the option for it, and might save you a bit of headache!

That option looks like this:

 ![image](https://europe1.discourse-cdn.com/n8n/original/3X/c/6/c6d2bdef2cf3aac9ccadb0419003cb692ca86e5f.png)

---

<div class="post-metadata">

**Author:** ![Sandeep\_Mallareddy](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/sandeep_mallareddy/32/12739_2.png) [@Sandeep\_Mallareddy](https://community.n8n.io/u/Sandeep_Mallareddy)\
**Post date:** [April 14, 2023, 11:23am UTC](https://community.n8n.io/t/error-cannot-find-module-crypto-line-1/25179/3 "2023-04-14T11:23:10Z")

</div>

Thank you for the quick reply! Appreciate it 😃

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [July 13, 2023, 11:24am UTC](https://community.n8n.io/t/error-cannot-find-module-crypto-line-1/25179/4 "2023-07-13T11:24:08Z")

</div>

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