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

Unable to run apps #30

Open
StanlyLife opened this issue May 25, 2023 · 1 comment
Open

Unable to run apps #30

StanlyLife opened this issue May 25, 2023 · 1 comment

Comments

@StanlyLife
Copy link

On npm run dev i receive an error:

node-express-convert-certs-and-sys-token\bin\www:26
 var key = fs.readFileSync(__dirname + '../certs/selfsigned.key'));
                                                                 ^

SyntaxError: Unexpected token ')'
    at Object.compileFunction (node:vm:360:18)
    at wrapSafe (node:internal/modules/cjs/loader:1088:15)
    at Module._compile (node:internal/modules/cjs/loader:1123:27)
    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)
    at node:internal/main/run_main_module:23:47

Node.js v18.12.1

fixing the bug by removing the extra parenthes. Then another error comes along:

Error: ENOENT: no such file or directory, open 'C:\Users\REDACTED\node-express-convert-certs-and-sys-token\bin../certs/selfsigned.key'
    at Object.openSync (node:fs:600:3)
    at Object.readFileSync (node:fs:468:35)
    at Object.<anonymous> (C:\Users\REDACTED\node-express-convert-certs-and-sys-token\bin\www:24:14)
    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)
    at node:internal/main/run_main_module:23:47 {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'C:\\Users\\REDACTED\\SuperOffice\\node-express-convert-certs-and-sys-token\\bin../certs/selfsigned.key'
}

replacing the formatting of the path to remove bin:

var key = fs.readFileSync(__dirname.substring(0, __dirname.length - 4) + "\\certs\\selfsigned.key");
var cert = fs.readFileSync(
	__dirname.substring(0, __dirname.length - 4) + "\\certs\\selfsigned.crt"
);

after applying the "fixes" the app stands at a stand still:
image

@josteink
Copy link
Member

josteink commented Dec 6, 2024

Thanks for the constructive feedback. Should be fixed in current version!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants