ietf-tools / idnits

Library / CLI to inspect Internet-Draft documents for a variety of conditions to conform with IETF policies.
BSD 3-Clause "New" or "Revised" License
12 stars 16 forks source link

Can't run #25

Closed larseggert closed 1 year ago

larseggert commented 1 year ago

After installing locally to my home directory (since I can't install with -g on this box):

# ~/node_modules/@ietf-tools/idnits/cli.js draft-ietf-ace-cmpv2-coap-transport-09.txt 
node:internal/process/esm_loader:97
    internalBinding('errors').triggerUncaughtException(
                              ^

[Error: ENOENT: no such file or directory, open './package.json'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: './package.json'
}

Node.js v18.13.0
rjsparks commented 1 year ago

Don't try to install @ietf-tools/idnits if you are developing. (You may need to restore package-lock.json and package.json). Just use npm install as noted further down the readme.

I can get to the point where the tests pass, but I can't yet run the CLI (I have an older node and it insists on v18 or greater.

rjsparks commented 1 year ago

I got node 18 working, and the cli now behaves as expected (very limited so far).

NGPixel commented 1 year ago

In your case, you would need to cd into ~/node_modules/@ietf-tools/idnits/ first, then run node cli.js from there.

However, it might be a better idea to simply use npx @ietf-tools/idnits <args> which should download the package in a local cache, rather than installing globally.

~Edit: the path is still wrong using npx... Looking into it...~ Edit: using npx is now working as expected.