1、报错信息:
npm ERR! code ECONNRESET
npm ERR! syscall read
npm ERR! errno ECONNRESET
npm ERR! network request to https://registry.npmjs.org/dayjs failed, reason: read ECONNRESET
npm ERR! network This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/zhaohui/.npm/_logs/2023-04-13T08_55_41_290Z-debug-0.log
2、报错原因:
执行命令安装,
npm install pm2 -g
-g,是全局安装,这样权限不够,需要加sudo
解决办法:
sudo npm install pm2 -g