Rob--W / proxy-from-env

A Node.js library to get the proxy URL for a given URL based on standard environment variables (http_proxy, no_proxy, ...).
MIT License
52 stars 19 forks source link

SyntaxError: The requested module 'proxy-from-env' does not provide an export named 'getProxyForUrl' #18

Open lenny-mo opened 1 year ago

lenny-mo commented 1 year ago

I try to run a nft-marketplace demo by using 'proxy-from-env' module. But the problem is, when I run "npm run dev" on terminal, it gives an error information which is "SyntaxError: The requested module 'proxy-from-env' does not provide an export named 'getProxyForUrl'".

And I found that there is really no export keyword for "getproxyforurl" function in "index.js" file, but I can find "export function getProxyForUrl(url: string|Url): string;" in "index.d.ts" file.

In fact, I am not good at javascript, and I don't know if this is the reason why my website is throwing this problem. Maybe I should add 'export' keyword before the 'function getProxyForUrl(url)' in "index.js" file.