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

Use a feature of Node v11.7.0 to extract a public key #3921

Closed
akihikodaki opened this issue Jan 18, 2019 · 2 comments · Fixed by #4572
Closed

Use a feature of Node v11.7.0 to extract a public key #3921

akihikodaki opened this issue Jan 18, 2019 · 2 comments · Fixed by #4572
Labels
packages/backend Server side specific issue/PR

Comments

@akihikodaki
Copy link
Contributor

akihikodaki commented Jan 18, 2019

Summary

Here is a good news: Node.js v11.7.0 now has a feature to extract a public key. It was introduced with the following pull request:
nodejs/node#25217

The API allowing to extract a public key is crypto.createPublicKey(key).
https://nodejs.org/api/crypto.html#crypto_crypto_createpublickey_key

It effectively replaces the functionality of src/crypto_key.cc, which I introduced in #1303 and a pull request recently merged, #3906, updated.

However, please note that the version of Node.js was released today (2019-01-18). You may carefully decide when to make such a change because it may not be widely available yet and some may prefer LTS versions.

Environment

Node.js v11.7.0


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@syuilo syuilo added the packages/backend Server side specific issue/PR label Jan 18, 2019
@JLKM
Copy link

JLKM commented Apr 5, 2019

Should I upgade my node.js?

I have spent a couple of evenings without getting misskey up and running, and some of the errors looks like this one with crypto key. Does the solution also match?

My setup
  • Server: Ubuntu 18.04 LTS
  • Node.js latest LTS
  • Misskey v. 10.98.3
Workaround with no luck

I would rather not upgrade to node 11.7.0+ as suggested in this issue and here and here. Is there another way out? And a quick one. I would really like to get on with my test of this awesome project as soon as possible.

For all those persistent people out there - have some highlights from my error log...
It fires up pretty ok
[21:40:53] Requiring external module ts-node/register
[21:40:56] Using gulpfile /etc/misskey/gulpfile.ts
[21:40:56] Starting 'build'...
[21:40:56] Starting 'build:ts'...
[21:40:56] Starting 'build:copy'...
[21:40:56] Starting 'build:client'...
[21:40:56] Starting 'doc'...
[21:40:56] Starting 'build:copy:views'...
[21:40:56] Starting '<anonymous>'...
[21:40:56] Starting 'build:client:script'...
[21:40:56] Starting 'build:client:styles'...
[21:40:56] Starting 'copy:client'...

But then:

[21:40:56] '<anonymous>' errored after 59 ms
[21:40:56] Error: File not found with singular glob: /etc/misskey/build/Release/crypto_key.node (if this was purposeful, use `allowEmpty` option)
    at Glob.<anonymous> (/etc/misskey/node_modules/glob-stream/readable.js:84:17)
    at Object.onceWrapper (events.js:277:13)
    at Glob.emit (events.js:189:13)
    at Glob.EventEmitter.emit (domain.js:441:20)
    at Glob._finish (/etc/misskey/node_modules/glob/glob.js:197:8)
    at done (/etc/misskey/node_modules/glob/glob.js:182:14)
    at Glob._processSimple2 (/etc/misskey/node_modules/glob/glob.js:688:12)
    at /etc/misskey/node_modules/glob/glob.js:676:10
    at Glob._stat2 (/etc/misskey/node_modules/glob/glob.js:772:12)
    at lstatcb_ (/etc/misskey/node_modules/glob/glob.js:764:12)

...and...

[21:40:56] 'build:copy' errored after 118 ms
[21:40:56] 'build' errored after 120 ms
[21:40:56] The following tasks did not complete: build:ts, build:client, doc, build:copy:views, build:client:script, build:client:styles, copy:client
[21:40:56] Did you forget to signal async completion?
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] build: `webpack && gulp build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

@acid-chicken
Copy link
Member

You should use yarn (my recommendation) or try to execute these commands.

  1. npm install -g node-gyp
  2. node-gyp configure
  3. node-gyp build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages/backend Server side specific issue/PR
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants