Yesterday I was giving training about Team Foundation Server when I wanted to demonstrate the tfs-cli tool. However when I tried to download the tool using npm install -g tfx-cli it failed. A company proxy was preventing npm to be able to connect to the outside world.
To fix this, you have to update the npm configuration file and specify the the
proxy setting. Open a command prompt and run the following command to do this:
npm config set proxy http://proxy.company.com:8080
We also noticed that the first time we did this it didn’t work because the user wasn’t authenticated yet at the proxy level. However after opening up a browser and surfing to a site outside the company network the user was authenticated to the proxy and we were able to call npm.