Home > Article > Web Front-end > A little bug about cnpm
In actual work, after a project is completed, the code often needs to be compressed before going online. Generally, gulp or webpack is used for compression. (My sister uses gulp) Gulp runs in the node environment.
So first, downloaded and installed node.
For convenience, select the binary file package of node and set the environment variables. Then enter node in the command line, "
After installing node, you need to use npm (Node Packaged Modules). npm is foreign and is easily "walled", so cnpm is often used instead.
Small tips: Baidu cnpm can find the "Taobao npm mirror" Copy the link
Enter in the command line:
npm install -g cnpm --registry=https://registry.npm.taobao.org
An error message appeared:
error ~ error. A large piece of English, what to do? ! ! ! ! (This is the screenshot + the original words of the little girl. Ma Dan, you are blind. You have been studying English for so many years. Don’t you know what is said in English?)
No hurry, first use "npm root" to find the root directory.
Did you see that she installed things on the c drive (well, I won’t complain, I think back then I also uprightly dedicated all the other d, e, and f drives to my movies, TV shows, pop songs, all Everything is installed on the c drive). Therefore, the suspected reason is: node is installed on the c drive. As a system disk, the c drive cannot be easily modified. So it cannot be installed and downloaded. (Don’t ask me why I said it was a suspicion. I was also afraid that I would make a mistake. If I made a mistake, it would be so embarrassing. Is it okay for girls to be shy?)
Solution:
Find the address in the error message.
Then right click--Properties--Security--enter the following interface:
Set all permissions inside to "Allow".
After setting, exit. At this point you can see some changes:
Enter the installation instructions in the command line again