foreword
In daily development, there are many factors that affect our development efficiency. Sometimes, it will not only affect the development efficiency, but also destroy our mentality.
In order to improve work efficiency, maintain a happy mood, and free up more time for the great cause of fishing, the predecessors have tossed a lot of useful tips. I will record a few of my commonly used tips here.
NPM set Taobao mirror source
If you want to manage Node packages, NPM is a hurdle that cannot be bypassed. You must figure it out before you can use it comfortably.
Before setting, we can query the current NPM source:
npm get registry
The general return should be: https://registry.npmjs.org/
, which is the default. Due to reasons that are hard to describe in China, sometimes when installing modules, the speed is really comparable to the speed of a turtle, and it may not be successful in the end.
In this case, we need to move our hands and set the NPM source to the domestic Taobao mirror source. The specific instructions are as follows:
npm config set registry http://registry.npm.taobao.org/
Now if you use NPM to pull the module, the speed is really great, nothing to say!
Afterwards, if you want to switch back to the original source, just execute the following command:
npm config set registry https://registry.npmjs.org/
Electron source modification
Even if the Taobao mirror source is set up, when installing the Electron module, since its compiled version is obtained from Github, the speed is really slow, and even the acquisition often fails. I have not suffered less from it before.
But since the Electron source has been relocated, the waist is not sore, the legs are not sore, and the development is not much more exciting! Specific steps are as follows:
Step 1: Go to " npmmirror China mirror site ", copy Electron mirror page address;
Step 2: Redirect the Electron source to the Electron mirror of the Chinese mirror site:
npm config set electron_mirror https://npmmirror.com/mirrors/electron/
After completing the redirection of the mirror source, the speed of installing Electron is as follows:
This experience is not only pleasant enough, but even the air is instantly sweet!
Summarize
Enjoy health and stay away from turtle speed!
I hope these little tips and tricks I've covered will keep your love of programming going!
PS: These tips are all made by the seniors in the development world, like paying tribute to them!
~
~ This article is over, thanks for reading!
~
Learn interesting knowledge, meet interesting friends, and shape interesting souls!
Hello everyone, I'm King , the author of 〖 Programming Samadhi 〗, my public number is " Programming Samadhi ", welcome to pay attention, I hope you can give me more advice!
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。