# Auth0 post login action cannot find module 'auth0' node16

**URL:** <https://community.auth0.com/t/auth0-post-login-action-cannot-find-module-auth0-node16/101985>\
**Category:** Get Help\
**Tags:** identifier-first, login-experience\
**Created:** [March 7, 2023, 10:51am UTC](https://community.auth0.com/t/auth0-post-login-action-cannot-find-module-auth0-node16/101985 "2023-03-07T10:51:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![eemil.ilkka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eemil.ilkka/32/45093_2.png) [@eemil.ilkka](https://community.auth0.com/u/eemil.ilkka)\
**Post date:** [March 7, 2023, 10:51am UTC](https://community.auth0.com/t/auth0-post-login-action-cannot-find-module-auth0-node16/101985/1 "2023-03-07T10:51:09Z")

</div>

When trying to use `var ManagementClient = require('auth0@3.0.1').ManagementClient;` or any version I found in [Can I require? - Search which node modules you can use in webtask.io](https://auth0-extensions.github.io/canirequire/#auth0)  
I get error:

```auto
{
"code": 400,
"message": "Compilation failed: Cannot find module 'auth0@3.0.1'\nRequire stack:\n- /data/io/node16/..../webtask.js",
"error": "Cannot find module 'auth0@3.0.1'\nRequire stack:\n- /data/io/node16/..../webtask.js",
....
}

```

What could be the cause?

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [March 8, 2023, 1:11am UTC](https://community.auth0.com/t/auth0-post-login-action-cannot-find-module-auth0-node16/101985/3 "2023-03-08T01:11:10Z")

</div>

Hey there @eemil.ilkka!

The only way I was able to reproduce this was by having a mismatched dependency defined in the Action vs. `require` - For example:

 ![Screenshot 2023-03-07 at 5.10.10 PM](https://global.discourse-cdn.com/auth0/original/3X/5/0/50525f884b3ba2abeb276d9f601a92be396373a1.png)

Are you able to confirm that this is not the case in your environment?

---

<div class="post-metadata">

**Author:** ![eemil.ilkka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/eemil.ilkka/32/45093_2.png) [@eemil.ilkka](https://community.auth0.com/u/eemil.ilkka)\
**Post date:** [March 8, 2023, 7:31am UTC](https://community.auth0.com/t/auth0-post-login-action-cannot-find-module-auth0-node16/101985/4 "2023-03-08T07:31:09Z")

</div>

The dependency is the same as in the code. I’ve also tried with not adding the `auth0` to the dependency. It works in `post user registration` just fine.

 ![working_post_reg](https://global.discourse-cdn.com/auth0/original/3X/2/a/2a1edecfc70b757d378955621a7bc06176ec691a.png)

but in login flow not

 ![not_working_post_login](https://global.discourse-cdn.com/auth0/original/3X/3/6/367f2601f53259e445043801c45be5b5b5a221f5.png)

```auto
{
"code": 400,
"message": "Compilation failed: Cannot find module 'auth0@3.0.1'\nRequire stack:\n- /data/io/node16/08df48a1-cfaf-47a3-9a9e-e03a0b1edc15/webtask.js",
"error": "Cannot find module 'auth0@3.0.1'\nRequire stack:\n- /data/io/node16/08df48a1-cfaf-47a3-9a9e-e03a0b1edc15/webtask.js",
"stack": "Error: Cannot find module 'auth0@3.0.1'\nRequire stack:\n- /data/io/node16/08df48a1-cfaf-47a3-9a9e-e03a0b1edc15/webtask.js\n at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)\n at Function.WebtaskModule._resolveFilename (/data/sandbox/lib/module.js:117:17)\n at WebtaskModule.require (/data/sandbox/lib/module.js:196:37)\n at require (/data/sandbox/lib/module.js:237:17)\n at module.exports (/data/io/node16/08df48a1-cfaf-47a3-9a9e-e03a0b1edc15/webtask.js:2:24)\n at /data/io/8386cedabc1a62d90b8687bcdcfeb725862055d8.js:5:162\n at Object.defaultJavascriptCompiler [as nodejsCompiler] (/data/sandbox/lib/compiler.js:137:14)\n at /data/io/8386cedabc1a62d90b8687bcdcfeb725862055d8.js:5:14\n at /data/sandbox/lib/compiler.js:294:11\n at /data/sandbox/node16/node_modules/async/dist/async.js:3883:24"
}

```

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [April 28, 2023, 10:50pm UTC](https://community.auth0.com/t/auth0-post-login-action-cannot-find-module-auth0-node16/101985/5 "2023-04-28T22:50:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [November 14, 2024, 8:15pm UTC](https://community.auth0.com/t/auth0-post-login-action-cannot-find-module-auth0-node16/101985/7 "2024-11-14T20:15:26Z")

</div>



---

<div class="post-metadata">

**Author:** ![alex.brett](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alex.brett/32/60157_2.png) [@alex.brett](https://community.auth0.com/u/alex.brett)\
**Post date:** [November 14, 2024, 9:43pm UTC](https://community.auth0.com/t/auth0-post-login-action-cannot-find-module-auth0-node16/101985/8 "2024-11-14T21:43:50Z")

</div>

Hello @eemil.ilkka!

After reviewing the code a bit more, it appears the correct code is:

`const ManagementClient = require('auth0').ManagementClient; `

No need to add the version number, ‘auth0’ works just fine!

Best,  
Alex

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [November 28, 2024, 9:44pm UTC](https://community.auth0.com/t/auth0-post-login-action-cannot-find-module-auth0-node16/101985/9 "2024-11-28T21:44:37Z")

</div>

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