npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY

Dinesh picture Dinesh · Aug 25, 2017 · Viewed 111.3k times · Source

I am trying all the ways of creating react application. I have tried with maven and now i am trying with crate-react-app build system from Facebook Incubators.

When i tried to run the command create-react-app my-app in npm environment, it worked on my personal system with no issues. But when i tried the same command in my work environment, i have encountered with this error on command prompt

npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLY

npm ERR! unable to get local issuer certificate
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

Answer

Dinesh picture Dinesh · Aug 25, 2017

A quick solution from the internet search was npm config set strict-ssl false, luckily it worked. But as a part of my work environment, I am restricted to set the strict-ssl flag to false.

Later I found a safe and working solution,

npm config set registry http://registry.npmjs.org/  

this worked perfectly and I got a success message Happy Hacking! by not setting the strict-ssl flag to false.