[Error solve] npm install error solve _ unable to verify the first certificate

 


1. Problem

You can meet SSL certificate problem problem on Company or private nework place. The error is like under text.

$ npm install --global --production windows-build-tools
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! request to https://registry.npmjs.org/windows-build-tools failed, reason: unable to verify the first certificate

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-09-00T04_57_24_465Z-debug.log

2. Solve

You can solve this problme using this command. I’ll hope solve your problem!

$ npm config set registry http://registry.npmjs.org/ --global