执行npm install -g @vue/cli
时报错
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! ***work Socket timeout
npm ERR! ***work This is a problem related to ***work connectivity.
npm ERR! ***work In most cases you are behind a proxy or have bad ***work settings.
npm ERR! ***work
npm ERR! ***work If you are behind a proxy, please make sure that the
npm ERR! ***work 'proxy' config is set properly. See: 'npm help config'
npm ERR! A ***plete log of this run can be found in:
npm ERR! D:\app\nodejs\node_cache\_logs\2023-02-27T07_01_05_797Z-debug.log
解决办法:
1. 执行如下命令 代理置为空
npm config set proxy null
2. 运行如下命令清理缓存
npm cache clean --force
3. 配置npm源
npm config set registry https://registry.npmmirror.***