0

It's showing my npm config proxy for http was set to undefined where as it was null for https

How to set http proxy to NULL

I tried various commands but none of it was helping

npm config --global rm http-proxy also tried

but it is still set to undefined.

This is my npmrc file.

;;;;
; npm userconfig file: C:\Users\udayb\.npmrc
; this is a simple ini-formatted file
; lines that start with semi-colons are comments
; run `npm help 7 config` for documentation of the various options
;
; Configs like `@scope:registry` map a scope to a given registry url.
;
; Configs like `//<hostname>/:_authToken` are auth that is restricted
; to the registry host specified.



;;;;
; all available options shown below with default values
;;;;


; _auth=null
; access=null
; all=false
; allow-same-version=false
; also=null
; audit=true
; audit-level=null
; auth-type=web
; before=null
; bin-links=true
; browser=null
; ca=null
; cache=C:\Users\udayb\AppData\Local/npm-cache
; cache-max=null
; cache-min=0
; cafile=null
; call=
; cert=null
; ci-name=null
; cidr=null
; color=true
; commit-hooks=true
; depth=null
; description=true
; dev=false
; 
; diff-ignore-all-space=false
; diff-name-only=false
; diff-no-prefix=false
; diff-dst-prefix=b/
; diff-src-prefix=a/
; diff-text=false
; diff-unified=3
; dry-run=false
; editor=C:\WINDOWS\notepad.exe
; engine-strict=false
; fetch-retries=2
; fetch-retry-factor=10
; fetch-retry-maxtimeout=60000
; fetch-retry-mintimeout=10000
; fetch-timeout=300000
; force=false
; foreground-scripts=false
; format-package-lock=true
; fund=true
; git=git
; git-tag-version=true
; global=false
; globalconfig=
; global-style=false
; heading=npm
; https-proxy=null
; if-present=false
; ignore-scripts=false
; 
; include-staged=false
; include-workspace-root=false
; init-author-email=
; init-author-name=
; init-author-url=
; init-license=ISC
; init-module=~/.npm-init.js
; init-version=1.0.0
; init.author.email=
; init.author.name=
; init.author.url=
; init.license=ISC
; init.module=~/.npm-init.js
; init.version=1.0.0
; install-links=false
; install-strategy=hoisted
; json=false
; key=null
; legacy-bundling=false
; legacy-peer-deps=false
; link=false
; local-address=null
; location=user
; lockfile-version=null
; loglevel=notice
; logs-dir=null
; logs-max=10
; long=false
; maxsockets=15
; message=%s
; node-options=null
; noproxy=
; offline=false
; 
; omit-lockfile-registry-resolved=false
; only=null
; optional=null
; otp=null
; 
; package-lock=true
; package-lock-only=false
; pack-destination=.
; parseable=false
; prefer-offline=false
; prefer-online=false
; prefix=
; preid=
; production=null
; progress=true
; provenance=false
; proxy=null
; read-only=false
; rebuild-bundle=true
; registry=https://registry.npmjs.org/
; replace-registry-host=npmjs
; save=true
; save-bundle=false
; save-dev=false
; save-exact=false
; save-optional=false
; save-peer=false
; save-prefix=^
; save-prod=false
; scope=
; script-shell=null
; searchexclude=
; searchlimit=20
; searchopts=
; searchstaleness=900
; shell=C:\WINDOWS\system32\cmd.exe
; shrinkwrap=true
; sign-git-commit=false
; sign-git-tag=false
; strict-peer-deps=false
; strict-ssl=true
; tag=latest
; tag-version-prefix=v
; timing=false
; tmp=C:\Users\udayb\AppData\Local\Temp
; umask=0
; unicode=false
; update-notifier=true
; usage=false
; user-agent=npm/{npm-version} node/{node-version} {platform} {arch} workspaces/{workspaces} {ci}
; userconfig=~/.npmrc
; version=false
; versions=false
; viewer=browser
; which=null
; 
; workspaces=null
; workspaces-update=true
; yes=null
  • The proxy in your npmrc is not the same as a module. Check `npm config list`, `npm config get https-proxy`, and see responses to [this question](https://stackoverflow.com/questions/7559648/is-there-a-way-to-make-npm-install-the-command-to-work-behind-proxy) for more examples (some outdated!). Additionally AFAICT `http-proxy` isn't valid, but you _can_ use `http` in the proxy URI with `https-proxy`. – Zac Anger May 24 '23 at 04:55
  • Tried but it's still showing proxy as undefined. I even tried to uninstall all node and npm packages and installed again but same error keeps on occuring. Because of this I was able to create a next app but unable to run it on localhost – Uday Satyanarayana May 24 '23 at 05:39
  • The https-proxy in your npm config has nothing to do with how you run your code. It's for how your machine interacts with the registry. (Also a correction to my previous comment, it looks like the insecure equivalent to `https-proxy` is plain `proxy` — but that still has nothing to do with actually running your app). You're confusing npm config with your actual code. – Zac Anger May 24 '23 at 05:51

0 Answers0