Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue using modules #56

Open
Bednaz98 opened this issue May 4, 2023 · 1 comment
Open

Issue using modules #56

Bednaz98 opened this issue May 4, 2023 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Bednaz98
Copy link

Bednaz98 commented May 4, 2023

Hey I downloaded the ue5 release and started playing around. I am using 5.1 if that makes a difference.
I can run a script as expected with a console.log, but when I tried to copy the code example over to use the ipc example it throughs the following error:

LogTemp: Error: Script Error: node:internal/modules/cjs/loader:998
  throw err;
  ^
Error: Cannot find module 'ipc-event-emitter'
Require stack:
- C:\Users\bedna\OneDrive\Documents\Unreal Projects\UnorthodoxSimulation\Content\Scripts\index.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Module._load (node:internal/modules/cjs/loader:841:27)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (C:\Users\bedna\OneDrive\Documents\Unreal Projects\UnorthodoxSimulation\Content\Scripts\index.js:4:13)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\bedna\\OneDrive\\Documents\\Unreal Projects\\UnorthodoxSimulation\\Content\\Scripts\\index.js'
  ]
}
Node.js v18.12.1

I currently have the Nodejs component set to auto resolve decencies and I am also calling it manually in my actor. The Node modules in the plugin are there. I also have the same dependencies listed in the package.json in the Content/Script as I do in the plugins package.json
I haven't changed the name of the files as its simply 'index.js' in the root of the 'Scripts' folder. If I component out the parts relating to the ipc I can get a console.log back.

are there any possible steps I missed?

I do have a global node 20 installed that I am using for other projects.

@getnamo
Copy link
Owner

getnamo commented May 11, 2023

I believe it's related to: #46

This hints at the change in new node releases that deprecate programmatic API for NPM. The plugin will need to retool to use the commandline api instead. Currently looking for help with this feature as the available time to fix it myself is unknown at this moment.

The workaround for now is to pre install dependencies by going into the script folder where you have your scripts and installing dependencies using commandline (or copying them over).

@getnamo getnamo added bug Something isn't working help wanted Extra attention is needed labels May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants