how can i solve npm ERR! error:0909006C:PEM in Node.js?

♀尐吖头ヾ 提交于 2020-08-19 10:19:45

问题


I'm new to Node.js. I tried to add RethinkDB module to my project, but I got: npm error:0909006C:PEM routines:get_name:no start line error.

I don't use a proxy, tried uninstalling/reinstalling Node.js, and changing the registry from the solutions I found online, but none of them worked.


回答1:


type this line npm set registry http://registry.npmjs.org/ and after that try again

I assume that your certificate is expired




回答2:


that what solved for me on windows ,

cmd:

ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub

then on cmd:

more jwtRS256.key

then copy privatekey to your config file , then:

put on every new line:

  /n

before :

    -----BEGIN RSA PRIVATE KEY-----
    MIIJKAIBAAKCAgEAlFVXSZ6llZItgZ0JaiyD7PO3l+b7PPqtt0U3iVyTs0qhEWJB
    Sa7nvyqth2Z+vOVuT5p97GJQ3nMx5CRQsF73YHdFFdUzfIDgFYOiPRT4pAw4l05r

after (on config json):

    "JWTPRIVATEKEY":"-----BEGIN RSA PRIVATE KEY-----\n
    MIIJKAIBAAKCAgEAlFVXSZ6llZItgZ0JaiyD7PO3l+b7PPqtt0U3iVyTs0qhEWJB\n
    Sa7nvyqth2Z+vOVuT5p97GJQ3nMx5CRQsF73YHdFFdUzfIDgFYOiPRT4pAw4l05r\n
    ....d8ul170=\n-----END RSA PRIVATE KEY-----"

then trim spaces:

    "JWTPRIVATEKEY": "-----BEGIN RSA PRIVATE KEY-----\nMI.............d8ul170=\n-----END RSA PRIVATE KEY-----",

then do the same with public key..

 more jwtRS256.key.pub

smile



来源:https://stackoverflow.com/questions/55236936/how-can-i-solve-npm-err-error0909006cpem-in-node-js

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!