coreybutler / node-windows

Windows support for Node.JS scripts (daemons, eventlog, UAC, etc).
Other
2.83k stars 356 forks source link

File path #353

Closed Fade253 closed 1 year ago

Fade253 commented 1 year ago

Issue: Im not sure if this can be seen as an issue but i am trying to run node-windows with a react app to run it as a service, the first problem i was having was it would refuse to import React with or without it being a module, which i managed to fix by using require, however when trying to do the same thing for the other imports that are giving grief i get this really long error and do not know what to do about it. as well in react to render the html inside it you need to have in the index but node-windows errors when it sees < because its inside index.js despite it being inside a render function which should bypass it, please help, and i found these errors in the errlog after running it node:internal/errors:496 ErrorCaptureStackTrace(err); ^

Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:' at new NodeError (node:internal/errors:405:5) at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:138:11) at defaultLoad (node:internal/modules/esm/load:89:3) at DefaultModuleLoader.load (node:internal/modules/esm/loader:263:26) at DefaultModuleLoader.moduleProvider (node:internal/modules/esm/loader:179:22) at new ModuleJob (node:internal/modules/esm/module_job:63:26) at #createModuleJob (node:internal/modules/esm/loader:203:17) at DefaultModuleLoader.getJobFromResolveResult (node:internal/modules/esm/loader:156:34) at DefaultModuleLoader.getModuleJob (node:internal/modules/esm/loader:141:17) at ModuleWrap. (node:internal/modules/esm/module_job:76:33) { code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME' }

Node.js v20.4.0

Fade253 commented 1 year ago

i am REALLY stupid and figured it out, i was using the development server when i needed to use express

coreybutler commented 1 year ago

Glad you figured it out! Don't beat yourself up.