0

I'm using ubuntu on Windows 10 to install and run npm. I downloaded nodejs using:

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

I set my proxy parameters using:

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

When doing npm install I get the following error:

...
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:  
...

I've checked similar posts but without any success: Using npm behind corporate proxy .pac npm behind a proxy fails with status 403

Please let me know if you have any idea on this one, best

ChrisB
  • 123
  • 1
  • 3
  • 13

2 Answers2

0

try this

export https_proxy=http://my.domain.name:port
export http_proxy=http://my.domain.name:port
Ravi Teja
  • 649
  • 7
  • 17
  • leave it export from bash alias – Ravi Teja Oct 11 '19 at 07:15
  • Here is the end of my log file:```3558 verbose stack Error: 403 Forbidden - GET https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz 3558 verbose stack at res.buffer.catch.then.body (/usr/lib/node_modules/npm/node_modules/npm-registry-fetch/check-response.js:104:15) 3558 verbose stack at process._tickCallback (internal/process/next_tick.js:68:7) 3559 verbose statusCode 403 3560 verbose pkgid acorn@5.7.13562 verbose Linux 4.4.0-18362-Microsoft 3563 verbose argv "/usr/bin/node" "/usr/bin/npm" "install" 3564 verbose node v10.16.3``` – ChrisB Oct 11 '19 at 07:47
0

Finally managed to solve my problem. The proxy settings defined by our admin didn't allow connections to https://registry.npmjs.org/. I had to define an exception to that particular address in my windows 10 proxy settings. Thanks for your help

ChrisB
  • 123
  • 1
  • 3
  • 13