报错代码
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