Reputation: 195
I'm having trouble using an npm package when connected to a forticlient vpn.
I'm using latest versions of nodejs and also npm.
The package I'm using is ctm-cli. This is a command line automation package for a work scheduling program called Control-M.
When I don't have my FortiClient VPN enabled I use the commands for the package, they work however complain they can't see the server, as I'm not connected to the VPN.
When I connect and then go to type the same command (i.e. ctm will trigger a list of commands) this will no longer work, I'm doing this all locally.
Has anybody got any idea what's going on here? I've tried:
Upvotes: 2
Views: 4228
Reputation: 102
this worked for me on my mac / unix based system:
run: scutil --proxy
you should get something that looks like this:
<dictionary> {
ExceptionsList : <array> {
0 : 18.0.0.0/8
1 : configuration.apple.com
2 : 192.168.0.0/16
3 : 172.16.0.0/12
4 : guzzon1.apple.com
5 : captiv3.apple.com
6 : push.apple.com
7 : smp-device-content.apple.com
8 : 127.0.0.1
9 : *.local
10 : xp.apple.com
11 : push-apple.com.akadns.net
12 : 100.64.0.0/10
13 : api.smoot.apple.com
14 : localhost
15 : 193.168.0.0/24
16 : 10.0.0.0/8
17 : ess.apple.com
}
HTTPEnable : 1
HTTPPort : 8118
HTTPProxy : 123.0.0.1
HTTPSEnable : 1
HTTPSPort : 8118
HTTPSProxy : 123.0.0.1
ProxyAutoConfigEnable : 0
SOCKSEnable : 1
SOCKSPort : 8119
SOCKSProxy : 123.0.0.1
}
then get these values from that list:
HTTPProxy : 123.0.0.1 HTTPPort : 8118
then include them in this command:
npm config set proxy http://123.0.0.1:8118
note* if permission problem occures then first run: sudo -s
if problem still occurs then include this:
npm config set https-proxy http://123.0.0.1:8118
reference: https://www.sneppets.com/angular/how-to-make-npm-install-command-to-work-behind-proxy/
Upvotes: 1
Reputation: 1105
Have you tried adding a .npmrc
file to the root of your project, where the registry points at the desired NPM registry?
registry=https://my-npm-registry.com/repo/
strict-ssl=false
Upvotes: 2