【问题标题】:NPM proxy problem when trying to install Vue CLI globally尝试全局安装 Vue CLI 时出现 NPM 代理问题
【发布时间】:2020-11-30 05:46:17
【问题描述】:

我尝试全局安装 Vue Cli,但没有安装,并且还显示了一些代理设置错误。我已经手动/cmd 在 .npmrc 文件上添加了一些值,如下所示,但它对我不起作用。

npm config set proxy http://proxy.mycompany.com:8080
npm config set https-proxy http://proxy.mycompany.com:8080

错误如下:

npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! network request to http://registry.npmjs.org/@vue%2fcli failed, reason: connect ETIMEDOUT 104.16.20.35:80
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\Viking_Castle\AppData\Roaming\npm-cache\_logs\2020-08-10T15_30_01_181Z-debug.log

【问题讨论】:

    标签: node.js vue.js npm npm-install


    【解决方案1】:

    我有类似的错误

    ?  Initializing git repository...
    ⚙️  Installing CLI plugins. This might take a while...
    npm ERR! code ETIMEDOUT npm ERR! errno ETIMEDOUT npm ERR! network request to https://cdn.npm.taobao.org/%40babel/plugin-transform-unicode-escapes/-/%40babel/plugin-transform-unicode-escapes-7.12.1.tgz failed, reason: connect ETIMEDOUT 129.227.206.207:443 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\Pradeep S\AppData\Roaming\npm-cache\_logs\2020-11-27T19_57_22_034Z-debug.log  ERROR  command failed: npm install --loglevel error
    

    R通过将 Wifi 连接更改为笔记本电脑解决了。使用移动热点连接,再次尝试从vue cli创建项目,这次成功了

    【讨论】:

      【解决方案2】:

      尝试使用以下命令删除代理并尝试安装它

      npm config rm proxy
      
      npm config rm https-proxy
      

      【讨论】:

      猜你喜欢
      • 2018-03-14
      • 1970-01-01
      • 1970-01-01
      • 2017-11-29
      • 2017-11-05
      • 1970-01-01
      • 2021-07-25
      • 2021-11-16
      • 1970-01-01
      相关资源
      最近更新 更多