# Post user registration failing to install modules and throwing generic error

**URL:** <https://community.auth0.com/t/post-user-registration-failing-to-install-modules-and-throwing-generic-error/125689>\
**Category:** Get Help\
**Tags:** hooks-management-api, management-api\
**Created:** [January 25, 2024, 11:46am UTC](https://community.auth0.com/t/post-user-registration-failing-to-install-modules-and-throwing-generic-error/125689 "2024-01-25T11:46:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![amondlane](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@amondlane](https://community.auth0.com/u/amondlane)\
**Post date:** [January 25, 2024, 11:46am UTC](https://community.auth0.com/t/post-user-registration-failing-to-install-modules-and-throwing-generic-error/125689/1 "2024-01-25T11:46:40Z")

</div>

I’m creating a new action to send messages to MS Teams, but the modules don’t seem to get installed.

This is the code:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/d/e/de8af3123fe7301edc80b35b48fe5f42792ada7b.png)

And the dependencies installed

![image](https://global.discourse-cdn.com/auth0/original/3X/4/3/43940d7b0095931ef85ed1d764ea92bf33fef46b.png)

and this is the error message I’m getting

![image](https://global.discourse-cdn.com/auth0/original/3X/4/0/40bb6f962d29dbdade6d6314c3169a05ec942b06.png)

The error is generic, but it seems that the modules are not getting installed.

Let me know if you need additional info

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [January 25, 2024, 12:50pm UTC](https://community.auth0.com/t/post-user-registration-failing-to-install-modules-and-throwing-generic-error/125689/3 "2024-01-25T12:50:55Z")

</div>

Hey @amondlane , thanks for a detailed report.

Installing the latest node modules leads me to question, what node version you use for runtime of your pre user registration actions?

 ![image](https://global.discourse-cdn.com/auth0/original/3X/b/c/bc0cb80b71096f87ecff4de83bab2c8ade5ea3e7.png)

Node 18 would be recommended.

Please keep us posted!

---

<div class="post-metadata">

**Author:** ![amondlane](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@amondlane](https://community.auth0.com/u/amondlane)\
**Post date:** [January 25, 2024, 2:53pm UTC](https://community.auth0.com/t/post-user-registration-failing-to-install-modules-and-throwing-generic-error/125689/4 "2024-01-25T14:53:34Z")

</div>

Hey @marcelina.barycka, I’m using node 18 as well.

I have tried running this command to manually install it, but reports nothing

npm install express body-parser axios

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [January 26, 2024, 8:40am UTC](https://community.auth0.com/t/post-user-registration-failing-to-install-modules-and-throwing-generic-error/125689/5 "2024-01-26T08:40:42Z")

</div>

Hey, thanks for letting us know @amondlane !

The issue with your script is that you are trying to build here an express app (not supported) and that the body of `exports.onExecutePostUserRegistration` function is empty so the Action does nothing. The logic within the body can be build on the flow-specific methods and properties listed in the [docs](https://auth0.com/docs/customize/actions/flows-and-triggers/pre-user-registration-flow/event-object).

When attempting to POST something to an external service or as part of the flow, don’t forget to add relevant secretes.

In terms of NPM modules management and limitations I found this doc useful -

- [Manage Dependencies](https://auth0.com/docs/customize/actions/manage-dependencies#limitations-for-dependencies-in-actions)

And for best practices for writing Actions script including error handling -

- [Action Coding Guidelines](https://auth0.com/docs/customize/actions/action-coding-guidelines)

Hope this helps!

---

<div class="post-metadata">

**Author:** ![amondlane](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@amondlane](https://community.auth0.com/u/amondlane)\
**Post date:** [January 26, 2024, 4:46pm UTC](https://community.auth0.com/t/post-user-registration-failing-to-install-modules-and-throwing-generic-error/125689/6 "2024-01-26T16:46:06Z")

</div>

@marcelina.barycka The results are for where the code is inside the brackets

 ![2024-01-26 11_42_55-Actions](https://global.discourse-cdn.com/auth0/original/3X/6/4/6429c7a8ce0bd9ea656a3f1e3c494228a3ae20f1.png)

The dependencies are added. I’ve read the docs but wasn’t able to find how to install the modules other than adding dependencies.

---

<div class="post-metadata">

**Author:** ![marcelina.barycka](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marcelina.barycka/32/56162_2.png) [@marcelina.barycka](https://community.auth0.com/u/marcelina.barycka)\
**Post date:** [January 29, 2024, 12:26pm UTC](https://community.auth0.com/t/post-user-registration-failing-to-install-modules-and-throwing-generic-error/125689/7 "2024-01-29T12:26:47Z")

</div>

Hi @amondlane ,

I don’t think the issue is with modules installation. In the link I’ve sent you the last time, there are errors codes you would receive for the missing dependencies.

You _can not_ create a webhook server (or any server) on Auth0 infrastructure as part of Auth0’s actions.

You do can send registration transaction data to an _external_ server by providing the full address of the server as well as including authorization data in the request if that is required by your webhook server.

There is a demo on a very similar Action to what your trying to do - [https://www.youtube.com/watch?v=9fnWwyYLU6Q](https://www.youtube.com/watch?v=9fnWwyYLU6Q)

Please let us know how it goes!

---

<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:** [February 12, 2024, 12:27pm UTC](https://community.auth0.com/t/post-user-registration-failing-to-install-modules-and-throwing-generic-error/125689/8 "2024-02-12T12:27:39Z")

</div>

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