Error When Trying to View NodeJS Remotely

Excuse my novice status, however, I need to know what this means so I can remedy the issue:

const server = require(’./lib/server’);

server.start();

This shows up when I try to view the page in the browser after publishing the page to the host (remote).

The page show with no issue when using the localhost:3000 (locally).

Wappler terminally displays a very long red error message that starts with:

Error: EISDIR: illegal operation on a directory, read at Object.readSync (fs.js:581:3) at tryReadSync (fs.js:357:20)

Somehow your NodeJS project is not setup correctly, you are serving the js code instead of executing it probably due to bad project structure.

Try creating a new project in Wappler and choose NodeJS as server model from the beginning to ensure your project structure is right.

Thanks George!

This is how it is set presently:

Is there another way to restart to a server model?

What kind of remote server do you have?

It looks like NodeJS is not installed.

MH2ag thanks for jumping in…
It’s a mySQL on Bluehost.

Doesn’t NodeJS get uploaded (installed) when published?

Did you check the following tutorial?

Oh! So there’s an additional item that needs to be activated on the host’s cPanel!

Yes, it does not work without separate setup.

So once it’s setup, all that’s needed afterward is to publish it to the server.

Does this have to be done with each new site built with NodeJS, or does it reside on the server for all subsequent subdomains, etc?

Is this where NodeJS will reside?

Yes, deploy should work after the installation.

I‘m not sure about subsequent subdomains as I didn‘t try this yet.

Thanks a lot my friend! I’m going to give it a go today. I appreciate your help very much.

1 Like

Sorry, I can‘t check at the moment because I‘m on my mobile phone.

No problem… your help has cleared the fog in my head regarding this topic. It was working on the localhost (locally), however when I published it, it failed. As a result I was stumped.

This is the result:

2663332 bytes transferred in 2938 seconds (906 B/s)
Upload completed successfully…
Error: EISDIR: illegal operation on a directory, read at Object.readSync (fs.js:581:3) at tryReadSync (fs.js:357:20) at Object.readFileSync (fs.js:394:19) at Object.dmxDWApiBridge.readString (chrome-extension://fjjllfpmlaejicjkpknbdicdakiijgjp/Shared/DMXzone/dmxAppCreator/dmxDWApiBridge/dmxNWApiBridge.js:8:41702) at e.dmxDWApiCallJsBridgingFunction (chrome-extension://fjjllfpmlaejicjkpknbdicdakiijgjp/Shared/DMXzone/dmxAppCreator/dmxDWApiBridge/dmxNWApiBridge.js:8:214) at Object.readString (chrome-extension://fjjllfpmlaejicjkpknbdicdakiijgjp/Shared/DMXzone/dmxAppCreator/dmxDWApiBridge/dmxDWApi.js:8:13783) at selectActionsTree (chrome-extension://fjjllfpmlaejicjkpknbdicdakiijgjp/Shared/DMXzone/dmxAppCreator/UI/dmxServerConnect/index.htm?theme=dark&app=true:1050:14) at HTMLDivElement. (chrome-extension://fjjllfpmlaejicjkpknbdicdakiijgjp/Shared/DMXzone/dmxAppCreator/UI/dmxServerConnect/index.htm?theme=dark&app=true:1461:9) at HTMLDivElement.dispatch (chrome-extension://fjjllfpmlaejicjkpknbdicdakiijgjp/Shared/DMXzone/dmxAppCreator/UI/jQuery/jquery-3.4.1.min.js:2:42571) at HTMLDivElement.v.handle (chrome-extension://fjjllfpmlaejicjkpknbdicdakiijgjp/Shared/DMXzone/dmxAppCreator/UI/jQuery/jquery-3.4.1.min.js:2:40572) at Object.trigger (chrome-extension://fjjllfpmlaejicjkpknbdicdakiijgjp/Shared/DMXzone/dmxAppCreator/UI/jQuery/jquery-3.4.1.min.js:2:70627) at k.fn.init.triggerHandler (chrome-extension://fjjllfpmlaejicjkpknbdicdakiijgjp/Shared/DMXzone/dmxAppCreator/UI/jQuery/jquery-3.4.1.min.js:2:71306) at l.jstree.plugins.fontawesome.trigger (chrome-extension://fjjllfpmlaejicjkpknbdicdakiijgjp/Shared/DMXzone/dmxAppCreator/UI/jsTree/jstree.js:8:12238) at l.jstree.plugins.fontawesome. (chrome-extension://fjjllfpmlaejicjkpknbdicdakiijgjp/Shared/DMXzone/dmxAppCreator/UI/jsTree/jstree.js:8:51440) at l.jstree.plugins.fontawesome.set_state (chrome-extension://fjjllfpmlaejicjkpknbdicdakiijgjp/Shared/DMXzone/dmxAppCreator/UI/jsTree/jstree.js:8:50250) at l.jstree.plugins.fontawesome.set_state (chrome-extension://fjjllfpmlaejicjkpknbdicdakiijgjp/Shared/DMXzone/dmxAppCreator/UI/jsTree/jstree.js:8:50193)

This error is something different - wrong selection in a tree or so. If you see it more often and can reproduce it - make a separate topic

1 Like

Okay, I will do that. Thank you.