当我尝试安装 @angular/cli 时,我遇到了这个问题

时间:2021-04-07 06:57:55

标签: angular

npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! network Invalid response body while trying to fetch https://registry.npmjs.org/resolve: aborted
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\kawthar\AppData\Local\npm-cache\_logs\2021-04-07T06_51_37_056Z-debug.log

1 个答案:

答案 0 :(得分:0)

在您尝试安装 @angular/cli 之前,您可以运行以下命令

npm config set registry http://registry.npmjs.org/

以便 npm 请求 http url 而不是 https

然后尝试运行以下命令

npm install

最后你可以尝试运行以下命令

npm install -g @angular/cli