Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL is not defined error #107

Closed
a10kiloham opened this issue Mar 7, 2020 · 2 comments
Closed

URL is not defined error #107

a10kiloham opened this issue Mar 7, 2020 · 2 comments

Comments

@a10kiloham
Copy link

a10kiloham commented Mar 7, 2020

with a fresh plain test.js


const normalizeUrl = require("normalize-url");
main();
function main(){
 let url = 'doctify.co.uk';
 website = normalizeUrl(url);
 console.log(website);
}
        const urlObj = new URL(urlString);
                       ^

ReferenceError: URL is not defined
    at normalizeUrl (/home/xxx/Dropbox/Node/Dealwatch/node_modules/normalize-url/index.js:93:17)
    at main (/home/xxx/Dropbox/Node/Dealwatch/test.js:6:12)
    at Object.<anonymous> (/home/xxx/Dropbox/Node/Dealwatch/test.js:3:1)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)
@sindresorhus
Copy link
Owner

Upgrade your Node.js version.

@a10kiloham
Copy link
Author

ah crap, thanks :) had no idea apt wouldn't update node automatically. i was on version 8!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants