Then I tried to check whether Node.js has been installed properly. Found out, nothing wrong with it. I suspected this is because of something wrong with the proxy setting as this happened in a corporate environment.
To see proxy server setting in Node.js, I ran:
npm config get proxyTurned out that the password used is my old password that was used when I installed Visual Studio. So I updated the setting with:
npm config set proxy http://[DOMAIN]%5C[USERNAME]:[PASSWORD]@[SERVER-ADDRESS]:[PORT-NUMBER]Then I tested the connectivity to Node.js registry server with:
npm pingThe result displayed was:
Ping error: Error: self signed certificate in certificate chain npm ERR! code SELF_SIGNED_CERT_IN_CHAIN npm ERR! self signed certificate in certificate chainThe error indicates there is something wrong with SSL connection. When I checked the ‘strict-ssl’ and ‘registry’ values with ‘npm config list -l’ command, they were ‘true’ and ‘https://registry.npmjs.org/’. So I ran these commands to change the connection to use non secured connection:
npm config set strict-ssl false npm config set registry http://registry.npmjs.org/Tried ‘npm ping’ again and the result was ‘Ping success: {}’.
Now, I could restore the missing packages in Visual Studio.
No comments:
Post a Comment