Skip to main content
Hey Evgenii
Inspiring
November 26, 2024
Answered

How to start node js server in CEP

  • November 26, 2024
  • 1 reply
  • 573 views

Hi, I am trying to use exiftool-vendored to read some EXIF metadata of media, I have node js script file that works perfectly, but as soon as I import it into the CEP panel context via 'require' it gives me 'Uncaught Error: Cannot find module 'node:events''. Events is native node module and it seems it is not available in cep context.

So I was trying to setup a simple server adding the tag to index.html:

<script>
var localServer = cep_node.require(__dirname + "/server/main.js")();
</script>

the server works perfectly and I am able to recieve callbacks, however as soon as I use require to get exiftool-vendored module into the server script file it breaks again

is there a way to run standalone server file, simillar to 'node server.js' that will be laucnhed from cep panel, but will have node js context?
This topic has been closed for replies.

1 reply

Bruce Bullis
Community Manager
Bruce BullisCommunity ManagerCorrect answer
Community Manager
November 26, 2024