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

npm WARN tarball tarball data for moment@^2.18.1 (sha1-DQVdU/UFKqZTyfbraLtdEr9cK1s=) seems to be corrupted. Trying one more time.

npm ERR! path C:\Users\Administrator\AppData\Roaming\npm\node_modules\.staging\moment-def6fe47\min\locales.js
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall unlink
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\.staging\moment-def6fe47\min\locales.js'
npm ERR!  { [Error: EPERM: operation not permitted, unlink 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\.staging\moment-def6fe47\min\locales.js']
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, unlink 'C:\Users\Administrator\AppData\Roaming\npm\node_modules\.staging\moment-def6fe47\min\locales.js'
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'unlink',

npm install -g cnpm --registry=https://registry.npm.taobao.org报错_第1张图片

解决方法:

npm install -g cnpm --registry=https://registry.npm.taobao.org报错_第2张图片

删掉AppData/Roaming下的npm,npm-cache两个安装包即可

你可能感兴趣的:(Web开发)