DaniloVaron
New Pleskian
- Server operating system version
- AlmaLinux 9.2
- Plesk version and microupdate number
- Plesk Obsidian 18.0.56
I have problems uploading a web page with node
First I got this error
/usr/share/passenger/helper-scripts/node-loader.js:80
return originalRequire.apply(this, arguments);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /var/www/vhosts/deunacolombia.com/desarrollo.deunacolombia.com/deunacolombia-node/index.js from /usr/share/passenger/helper-scripts/node-loader.js not supported.
Instead change the require of index.js in /usr/share/passenger/helper-scripts/node-loader.js to a dynamic import() which is available in all CommonJS modules.
at Module.require (/usr/share/passenger/helper-scripts/node-loader.js:80:25)
at loadApplication (/usr/share/passenger/helper-scripts/node-loader.js:243:2)
at setupEnvironment (/usr/share/passenger/helper-scripts/node-loader.js:214:2)
at Object.<anonymous> (/usr/share/passenger/helper-scripts/node-loader.js:133:1) {
code: 'ERR_REQUIRE_ESM'
}
I tried a workaround from the same forum by creating an index.cjs file containing
import('./index.js').then(() => console.log('@@@@@@@ WORKED')).catch(e => console.log('@@@@@ @@ FAILED', e.message, e.stack));
making sure that the executable was that file.
Now the page has a 504 error
I use .ejs as templates and the page views are located here...
Does anyone have a solution please
Thanks
First I got this error
/usr/share/passenger/helper-scripts/node-loader.js:80
return originalRequire.apply(this, arguments);
^
Error [ERR_REQUIRE_ESM]: require() of ES Module /var/www/vhosts/deunacolombia.com/desarrollo.deunacolombia.com/deunacolombia-node/index.js from /usr/share/passenger/helper-scripts/node-loader.js not supported.
Instead change the require of index.js in /usr/share/passenger/helper-scripts/node-loader.js to a dynamic import() which is available in all CommonJS modules.
at Module.require (/usr/share/passenger/helper-scripts/node-loader.js:80:25)
at loadApplication (/usr/share/passenger/helper-scripts/node-loader.js:243:2)
at setupEnvironment (/usr/share/passenger/helper-scripts/node-loader.js:214:2)
at Object.<anonymous> (/usr/share/passenger/helper-scripts/node-loader.js:133:1) {
code: 'ERR_REQUIRE_ESM'
}
I tried a workaround from the same forum by creating an index.cjs file containing
import('./index.js').then(() => console.log('@@@@@@@ WORKED')).catch(e => console.log('@@@@@ @@ FAILED', e.message, e.stack));
making sure that the executable was that file.
Now the page has a 504 error
I use .ejs as templates and the page views are located here...
Does anyone have a solution please
Thanks