i'm from china ,For some reason i use foreign mirror is not good . i can config yarn use chinese taobao's npm mirror ?
Yes, you can do this! You can run
npm config set registry https://registry.npm.taobao.org
This will set it in npm's configuration (.npmrc file in your home directory), and Yarn will reuse this same configuration. Every time you install an npm package, it will come from Taobao's mirror 😃
thanks,It works great!
@Daniel15 What about @types/<package> packages.
After setup the Chinese mirror, I still get
error An unexpected error occurred: "https://registry.yarnpkg.com/@types/ws/-/ws-0.0.41.tgz: ETIMEDOUT".
yarn --version
0.27.5
@Daniel15 Never mind, fixed by remove yarn.lock
try:
yarn config set registry 'https://registry.npm.taobao.org'
how do you revert the changes?
@jjhesk you can run this command
npm config delete registry
# or
yarn config delete registry
Or delete registry key manually in ~/.npmrc or ~/.yarnrc file.
Most helpful comment
Yes, you can do this! You can run
This will set it in npm's configuration (
.npmrcfile in your home directory), and Yarn will reuse this same configuration. Every time you install an npm package, it will come from Taobao's mirror 😃