I've got node.js installed and running on pc. When I make a pakage.json as shown below, then in that folder run cmd
npm install socket.io
or
npm install
it gives the error
unable to verify the first certificate
How can I fix this?
package.json
{
"name": "app",
"version": "0.0.1",
"description": "app",
"dependencies": {
"socket.io": "latest"
},
"author": "shadryck"
}
NOTE: I am completely new to node.js and socket.io. I'm just trying to get started with it somehow.
NOTE: if for some reason you're going to downvote this at least explain why. I do have done my research and was unable to find an answer anywhere.
UPDATE: fixed it by reinstalling node.js and restarting pc after not having restarted it for a very long time.
UPDATE: installed python, but now its whining for even more errors. screenie
You might also be able to just switch to use the regular HTTP registry instead of the default HTTPS one by running:
As mentioned in npm issue 8872
As you're not behind a proxy, I think this may be an issue with the SSL Root Certificate Authorities trusted.
Firstly you can try force NPM to use known registrars
If this doesn't work, it's perhaps due to missing certs from the install.
You can try reinstall/upgrade NPM with the appropriate certs by doing the following in order
If that still fails you might have to forcibly download the missing CA's. Luckily there's a library for fixing this. Unfortunately there's a security pitfall in the process. (I'm open to hearing improvements!).
Firstly, turn off ssl in npm (this is the security pitfall) by using
then you can install
then simply type node and in the REPL type
then turn back on SSL and test