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

[BUG] Problem with command line parsing #20

Open
kettenbach-it opened this issue Sep 27, 2022 · 0 comments
Open

[BUG] Problem with command line parsing #20

kettenbach-it opened this issue Sep 27, 2022 · 0 comments
Labels
Type: Bug Something isn't working

Comments

@kettenbach-it
Copy link
Contributor

Summary

I want to supply the name of the file containing my self description as a command line parameter.
From the index.js I see, that this is supposed to work as third parameter.

I keep the program in a unmodified subdirectory self-description-signer (created by git submodule add) - all files that I work with are outside of this git repo.

My config therefore is in ./config (outside of self-description-signer)

Current Behavior

I call this command:

❯ node self-description-signer/index.js ./participant-self-description.json
node:internal/modules/cjs/loader:936
  throw err;
  ^

Error: Cannot find module './participant-self-description.json'
Require stack:
- /Users/volker/Huawei/Boot-X/boot-x-iac/Self Description Signing/self-description-signer/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/Users/volker/Huawei/Boot-X/boot-x-iac/Self Description Signing/self-description-signer/index.js:10:25)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/volker/Huawei/Boot-X/boot-x-iac/Self Description Signing/self-description-signer/index.js'
  ]
}

and get an error.
The same with node self-description-signer/index.js participant-self-description.json
or with node self-description-signer/index.js $PWD/participant-self-description.json

Expected Behavior

I would expect my file ./participant-self-description.json to be signed.
Strangely, if I leave out the third parameter, it will sign the example in self-description-signer/config and put the output to output

Steps to Reproduce

Enter the above commands.

Environment

❯ node -v
v16.13.0

Anything else

@kettenbach-it kettenbach-it added the Type: Bug Something isn't working label Sep 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant