Install
npm install cnpm -g --registry=https://registry.npm.taobao.org
An error will be reported that there is no permission. In this case, sudo needs to be added.
sudo npm install cnpm -g --registry=https://registry.npm.taobao.org
At this time, if some people will report errors, such as expired certificates and inability to access, etc.,
they need to be added.
npm config set strict-ssl false
Cancel https authentication
The final problem that may occur is that when npm-v prompts an error,
this is because the cnpm version is inconsistent with the current npm version.
At this time, we need to uninstall cnpm.
npm uninstall cnpm
Then check the current npm version
npm -v
It is found that the current version is 6.14.8.
Then we reinstall cnpm and specify the version.
sudo npm install -g [email protected] --registry=https://registry.npm.taobao.org
At this time we
cnpm -v
Successful installation