Unable when downloading NPM_ TO_ VERIFY_ LEAF_ Signature error

Recently, after the system has been re installed and the node has been re installed, I don’t know what happened. NPM can’t be downloaded,
it’s reported as unable_ TO_ VERIFY_ LEAF_ Signature error

As shown in the figure, this sentence is displayed

npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE

By default, NPM adopts the HTTPS protocol. In fact, our package has no security

In addition, the problem of GFW in using HTTPS leads to the error of NPM install, that is to say, NPM is blocked

(1) Turn off strict SSL, that is, turn off the HTTPS of NPM and use HTTP protocol instead

npm config set strict-ssl false

When we need to re enable it, set it again:

npm config set strict-ssl true

(2) We can also reset the access address of NPM

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

Similar Posts: