在尝试全局安装webpack及其CLI时遇到npm网络错误`ERR_SOCKET_TIMEOUT`,导致安装失败。通过执行`npm install rxjs`和再次尝试安装webpack,最终成功运行`npm run dev`。问题可能是由于网络连接不稳定或代理设置不当引起。
报错解决
npm ERR! code ERR_SOCKET_TIMEOUT
npm ERR! errno ERR_SOCKET_TIMEOUT
npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/node-releases: Socket timeout
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! C:\Users\rain\AppData\Local\npm-cache\_logs\2022-02-28T07_09_06_205Z-debug-0.log