簡體   English   中英

npm 安裝在 Windows 10 后面的 Ubuntu 上顯示 403 錯誤

[英]npm install shows 403 Error on Ubuntu on Windows 10 behind proxy

我在 Windows 10 上使用 ubuntu 來安裝和運行 npm。 我使用以下方式下載了nodejs:

curl -sL https://deb.nodesource.com/setup_10.x | bash 
apt-get install -yq nodejs 

我使用以下方法設置代理參數:

npm config set proxy http://my.domain.name:port
npm config set https-proxy http://my.domain.name:port

npm install時出現以下錯誤:

...
npm ERR! code E403
npm ERR! 403 Forbidden - GET https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz
npm ERR! A complete log of this run can be found in:  
...

我檢查了類似的帖子,但沒有任何成功: Using npm behind Corporate proxy.pac npm behind a proxy failed with status 403

如果您對此有任何想法,請告訴我,最好

嘗試這個

export https_proxy=http://my.domain.name:port
export http_proxy=http://my.domain.name:port

終於設法解決了我的問題。 我們的管理員定義的代理設置不允許連接到https://registry.npmjs.org/ 我必須在我的 windows 10 代理設置中為該特定地址定義一個例外。 謝謝你的幫助

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM