Issues Related To Fastgithub And Other Self-Signed Certificates In Language-Specific Package Managers

package manager
self-signed certificate
system manage
This article addresses the issue of slow download speeds caused by self-signed certificates in language-specific package managers like npm and yarn. It proposes solutions such as using cnpm, a version of the npm command-line interface that uses a different registry, and configuring binary distribution file mirrors to improve performance.
Published

August 15, 2022


npm

npm报错:unable to verify the first certificate

npm config set strict-ssl false
npm config set ca=""

npm download binary files from github will raise error since the download speed is low.

use cnpm instead, since it will route all github binary requests to mirrored cnpm cdn.

npm i -g cnpm

set some binary distribution file mirror to https://registry.npmmirror.com in ~/.npmrc and ~/.yarnrc:

canvas_binary_host_mirror=https://registry.npmmirror.com/-/binary/canvas/
sass_binary_site=https://registry.npmmirror.com/-/binary/node-sass
nodejs_org_mirror=https://registry.npmmirror.com/-/binary/node/
electron_mirror=https://registry.npmmirror.com/-/binary/electron/
electron_builder_binaries_mirror=https://registry.npmmirror.com/-/binary/electron-builder-binaries/
chromedriver_cdnurl=https://registry.npmmirror.com/-/binary/chromedriver/
registry=https://registry.npmmirror.com