Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Node 15: The property 'options.publicKeyEncoding.format' is invalid. Received 'jwk' #221

Closed
D4nte opened this issue Dec 7, 2021 · 5 comments · Fixed by #230
Closed

Node 15: The property 'options.publicKeyEncoding.format' is invalid. Received 'jwk' #221

D4nte opened this issue Dec 7, 2021 · 5 comments · Fixed by #230
Labels

Comments

@D4nte
Copy link
Contributor

D4nte commented Dec 7, 2021

Latest release says that only node 15+ is supported: https://github.com/libp2p/js-libp2p-crypto/releases/tag/v0.21.0

Note that the package.json was not updated accordingly:

"node": ">=12.0.0"

Node 15 is actually not supported as we can see when running the CI with 15: https://github.com/D4nte/js-libp2p-crypto/runs/4438572378?check_suite_focus=true

TypeError [ERR_INVALID_ARG_VALUE]: The property 'options.publicKeyEncoding.format' is invalid. Received 'jwk'

Only node 16 works.

I wonder if it's due to this bug only fixed on node 16: nodejs/node#39205

@D4nte
Copy link
Contributor Author

D4nte commented Jan 6, 2022

So actually Node 15 has reach end-of-life support. It may make more sense to just say that the library supports node 16 and above.

D4nte added a commit to D4nte/js-libp2p-crypto that referenced this issue Jan 6, 2022
This library does not work with node 15 (libp2p#221).
Moreover, node 15 has reached End-of-Life.

Resolves libp2p#221.
achingbrain pushed a commit that referenced this issue Jan 8, 2022
This library does not work with node 15 (#221).

Moreover, node 15 has reached End-of-Life.
github-actions bot pushed a commit that referenced this issue Jan 8, 2022
### [0.22.4](v0.22.3...v0.22.4) (2022-01-08)

### Trivial Changes

* change min node support to 16 ([#230](#230)) ([9aabfe6](9aabfe6)), closes [#221](#221)
* **deps:** bump node-forge from 0.10.0 to 1.1.0 ([#231](#231)) ([d33eea1](d33eea1))
@github-actions
Copy link

github-actions bot commented Jan 8, 2022

🎉 This issue has been resolved in version 0.22.4 🎉

The release is available on:

Your semantic-release bot 📦🚀

@richburdon
Copy link

I still see this problem using Node 16

Code/dxos/libp2p-demo  main ✗                                                                                                                                             ⚑ ✚ ◒
▶ node --version
v16.1.0
Code/dxos/libp2p-demo  main ✗                                                                                                                                             ⚑ ✚ ◒
▶ yarn start
yarn run v1.22.5
$ ts-node ./src/main.ts
TypeError [ERR_INVALID_ARG_VALUE]: The property 'options.publicKeyEncoding.format' is invalid. Received 'jwk'
    at new NodeError (node:internal/errors:363:5)
    at parseKeyFormat (node:internal/crypto/keys:268:9)
    at parseKeyFormatAndType (node:internal/crypto/keys:304:18)
    at parseKeyEncoding (node:internal/crypto/keys:332:7)
    at parsePublicKeyEncoding (node:internal/crypto/keys:371:10)
    at parseKeyEncoding (node:internal/crypto/keygen:125:9)
    at createJob (node:internal/crypto/keygen:161:42)
    at generateKeyPair (node:internal/crypto/keygen:75:15)
    at node:internal/util:335:7
    at new Promise (<anonymous>) {
  code: 'ERR_INVALID_ARG_VALUE'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@D4nte
Copy link
Contributor Author

D4nte commented Feb 2, 2022

I still see this problem using Node 16

Code/dxos/libp2p-demo  main ✗                                                                                                                                             ⚑ ✚ ◒
▶ node --version
v16.1.0
Code/dxos/libp2p-demo  main ✗                                                                                                                                             ⚑ ✚ ◒
▶ yarn start
yarn run v1.22.5
$ ts-node ./src/main.ts
TypeError [ERR_INVALID_ARG_VALUE]: The property 'options.publicKeyEncoding.format' is invalid. Received 'jwk'
    at new NodeError (node:internal/errors:363:5)
    at parseKeyFormat (node:internal/crypto/keys:268:9)
    at parseKeyFormatAndType (node:internal/crypto/keys:304:18)
    at parseKeyEncoding (node:internal/crypto/keys:332:7)
    at parsePublicKeyEncoding (node:internal/crypto/keys:371:10)
    at parseKeyEncoding (node:internal/crypto/keygen:125:9)
    at createJob (node:internal/crypto/keygen:161:42)
    at generateKeyPair (node:internal/crypto/keygen:75:15)
    at node:internal/util:335:7
    at new Promise (<anonymous>) {
  code: 'ERR_INVALID_ARG_VALUE'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Update your node install. nodejs/node#39205 was initially reported on 16.4 so fixed after that and you have 16.1.

@richburdon
Copy link

richburdon commented Feb 2, 2022

Wow, thanks so much for the quick response. That worked.

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

Successfully merging a pull request may close this issue.

2 participants