安装淘宝镜像cnpm报错

npm 安装淘宝镜像报错

npm install -g cnpm --registry=https://registry.npm.taobao.org

安装报

The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!

-4048

解决办法 

把这句命令

npm install -g cnpm --registry=https://registry.npm.taobao.org

改成指定版本就好了(版本号可以根据自己需求来)

npm install -g cnpm@7.1.1 --registry=https://registry.npm.taobao.org

就可以了