无法使用npm安装vue-cli

时间:2022-12-31 13:46:52

I have installed the latest version of npm and with that, I am trying to install vue-cli using the command

我已经安装了最新版本的npm,并且我正在尝试使用该命令安装vue-cli

npm install --global vue-cli

But I am running into issues stated below:

但是我遇到了以下问题:

    npm ERR! code EPROTO
npm ERR! errno EPROTO
npm ERR! request to http://registry.npmjs.org/vue-cli failed, reason: write EPROTO 101057795:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:openssl\ssl\s23_clnt.c:827:
npm ERR!

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\pd0ufv\AppData\Roaming\npm-cache\_logs\2018-02-02T17_02_16_113Z-debug.log

I have set my proxy setting as well using

我也设置了我的代理设置

npm set http-proxy <proxy>

npm设置http-proxy

npm set https-proxy <proxy>

npm设置https-proxy <代理>

but didn't work as well. I am using npm version 5.6.0.

但没有奏效。我使用的是npm版本5.6.0。

1 个解决方案

#1


1  

Most of the time this error is because the firewall you're behind doesn't actually support SSL peering but will mimic it if you use their http passthrough, so change your https-proxy definition accordingly:

大多数情况下,此错误是因为您背后的防火墙实际上并不支持SSL对等,但如果您使用其http passthrough,则会模仿它,因此请相应地更改您的https-proxy定义:

npm set https-proxy http://example.com

#1


1  

Most of the time this error is because the firewall you're behind doesn't actually support SSL peering but will mimic it if you use their http passthrough, so change your https-proxy definition accordingly:

大多数情况下,此错误是因为您背后的防火墙实际上并不支持SSL对等,但如果您使用其http passthrough,则会模仿它,因此请相应地更改您的https-proxy定义:

npm set https-proxy http://example.com