首页 > 解决方案 > 安装 npm 包时的 UNABLE_TO_VERIFY_LEAF_SIGNATURE

问题描述

我几天前更新了npm。尝试安装 parcel-bundler 时出现以下错误。

npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning UNABLE_TO_VERIFY_LEAF_SIGNATURE: request to https://registry.npmjs.org/parcel-bundler failed, reason: unable to verify the first certificate
npm WARN registry Using stale data from https://registry.npmjs.org/ due to a request error during revalidation.
npm ERR! code UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! errno UNABLE_TO_VERIFY_LEAF_SIGNATURE
npm ERR! request to https://registry.npmjs.org/js-yaml failed, reason: unable to verify the first certificate

我尝试将 strict-ssl 设置为 false 。我收到以下错误。

npm ERR! code E403
npm ERR! 403 403 npmjsorgcoachpage - GET https://registry.npmjs.org/parcel-bundler
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy.
npm version 6.13.4
node version v12.14.1

标签: node.jsnpmnpm-install

解决方案


推荐阅读