3

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.

enter image description here

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.

karel
  • 5,489
  • 46
  • 45
  • 50
serdar
  • 41
  • 1
  • 1
  • 6
  • Since you are on windows, it is likely that there is a problem with your certificate format, or you are providing the wrong path. – AHT Mar 19 '19 at 09:06
  • 1
    I can install it to the nodejs folder. But shouldn't I also install it to the project's folder? – serdar Mar 19 '19 at 09:11
  • Do you mean that you can install it globally but not locally? – AHT Mar 19 '19 at 09:13
  • Yes, I can install anything globally but locally i can't install anything. – serdar Mar 19 '19 at 09:15
  • Can you maybe uninstall the global version, and delete the node_modules directory in your project and reinstall locally? – AHT Mar 19 '19 at 09:25
  • I did what you recommend but still not able to install locally. Is there a workaround to use glabol module on the local folder? – serdar Mar 19 '19 at 10:56
  • Just add the path to your `PATH` environment variable. Here's a helpful post to achieve that https://stackoverflow.com/questions/27864040/fixing-npm-path-in-windows-8-and-10/27864331 – AHT Mar 19 '19 at 10:58
  • I add the path but now I get the error; npm ERR! code E404 npm ERR! 404 Not Found - GET http://registry.npmjs.org/bluebird npm ERR! 404 npm ERR! 404 'bluebird@>= 2.3.2 < 3' is not in the npm registry. – serdar Mar 21 '19 at 07:54
  • I tried it and it works just fine. Maybe try to change this to `bluebird@3.0` or to `bluebird@^2.3.2` depending on whether you know the exact version or not. – AHT Mar 21 '19 at 10:24

2 Answers2

5

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

I assume that your certificate is expired

Miguel Yustiz
  • 51
  • 1
  • 2
1

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

aris
  • 409
  • 6
  • 8