Set npmrc to solve the problem of NPM or Yarn depending on slow download (for example, Electron)

The wall seems to have been raised recently, and Github's aws have also been damaged by the wall. When the Yarn installation relies on the Electron, it is stuck in the Linking dependencies And Building fresh packages The steps of the process are as follows: the Electron goes around and around. It took five minutes to finish.

resolvent

Add a .npmrc File:

 #powershell New-Item .npmrc #linux touch .npmrc

Add Taobao image source to the file:

 sass_binary_site= https://npm.taobao.org/mirrors/node-sass/ registry= https://registry.npm.taobao.org ELECTRON_MIRROR= https://npm.taobao.org/mirrors/electron/

Later, reusing NPM or Yarn installation dependency can basically solve the problem.

In addition, set .npmrc It can solve the problem that most dependencies cannot be pulled down and the download is slow.

other

It is recommended to put a copy of. npmrc file in the root directory of each project, which is not only convenient for yourself, but also convenient for multiple people to collaborate.

By the way, what's the special significance of shielding these software repositories?

Zimiao haunting blog (azimiao. com) All rights reserved. Please note the link when reprinting: https://www.azimiao.com/6177.html
Welcome to the Zimiao haunting blog exchange group: three hundred and thirteen million seven hundred and thirty-two thousand

Comment

*

*

Comment area

  1. c0sMx 04-29 18:31 reply

    The special period is coming again.