Node.js

Okay, so it seems that sometimes when I PIE the Main Script does not connect.
When it successfully does, after about a minute SocketIO just disconnects (CLOSE_REASON_NORMAL) and then I have to restart the editor to be able to make the nodejs script run again.

Any help?

I stumbled upon the answer to my own question. So, the script I am running requires me to install node modules in the Scripts folder. When I try calling the ipc-event-emitter module from the script, it cannot find it in the Scripts folder. I tried installing the node-ipc-event-emitter directly into the Scripts folder but I think there’s some necessary modules that are not included in that installation (I would be forever grateful if you could point me towards the right one).

So, I copy/pasted only the node_modules folder from Plugins\nodejs-ue4\Content\Scripts and skipped any repeated files to make sure I had all necessary modules present in the Scripts folder.

Worked like a charm.

1 Like

Do I need Node.js installed on other computers, if I want to play a (already packaged) game with this plugin?

The packaged project should force the plugin to include a local embedded node and npm, but may have to just add a folder to package copying step in settings for everything to work as expected.

See GitHub - getnamo/NodeJs-Unreal: Embed node.js as an Unreal Engine plugin. for details.

Thank you for sharing amazing plugins!!
I want to share my setup for you.

I am coding in Angular and Nestjs at the same time. So I am familiar with Typescript. I use Nrwl to manage my base setting.

$ npx create-nx-workspace
$ npm install @nrwl/node
$ nx generate @nrwl/node:app main

You will get something like this

We can watch the project by

$ npm start

In NodeJs-Unreal make sure your script path.
dist\apps\{ProjectName}\main.js

Enjoy using it! I use this plugin as extendtion for Unreal. It’s perfect solution for me.
image

1 Like