安装mirror-config-china遇到的问题

报错代码

EACCES: permission denied, open '/Users/zwind/.npmrc'
Please try running this command again as root/Administrator.
(node:746) UnhandledPromiseRejectionWarning: Error: EACCES: permission denied, open '/Users/zwind/.bash_profile'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:746) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:746) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mirror-config-china@2.5.1 install: `node lib/install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mirror-config-china@2.5.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/zwind/.npm/_logs/2020-07-28T07_17_08_630Z-debug.log

解决方案
首先清除缓存
npm cache clean -f
然后安装
npm i -g mirror-config-china --registry=https://registry.npm.taobao.org -f

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

友情链接更多精彩内容