question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Throws error "URL is not defined"

See original GitHub issue

Expected Behavior

Some vulnerability report should be shown as output

Current Behavior

λ npx is-website-vulnerable http://google.com
npx: installed 235 in 24.612s
URL is not defined

Steps to Reproduce (for bugs)

  1. run npx is-website-vulnerable http://google.com
  2. wait for results
  3. read error URL is not defined

Your Environment

  • Library Version used: latest
  • Node.js version: 8.16.1
  • Operating System: Windows 10, up to date

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
doncullencommented, Oct 7, 2019

Upgrading Node.js to v12.11.1 solved the issue, like you suggested. I didn’t test on < 10 since I didn’t see new comment saying you implemented workaround at the time I did the upgrade. Working fine now. Thanks for the quick fix!

0reactions
smeijercommented, Oct 7, 2019

Can confirm that it’s working on v8.16 now as well.

λ npx is-website-vulnerable http://google.com
npx: installed 237 in 13.715s

  Website: https://www.google.com/?gws_rd=ssl

  ○ No JavaScript libraries detected with publicly known security vulnerabilities

  [0] Total vulnerabilities
  [2312.85ms] execution time

  vulnerabilities powered by Snyk.io (https://snyk.io/vuln?type=npm)
Read more comments on GitHub >

github_iconTop Results From Across the Web

URL is not defined in node.js - Stack Overflow
Try to add this line: var URL = require('url').URL;. The full example is here: var URL = require('url').URL; var myURL = new ...
Read more >
ReferenceError: URL is not defined [Temporary fix] · Issue #859
Hello, i am using the current version 4.4.3, i am getting ReferenceError: URL is not defined i had to comment out line 84...
Read more >
[Solved] Make Build Error (URL not defined) - Install & Config
I installed the npm packages using yarn instead of npm , just got encountered hang problem in npm install due to git --config...
Read more >
ReferenceError: URL is not defined - Nehemiah Blog
Workaround: In case if you can't or don't want to upgrade, you can add the var URL = require('url').URL; in the js file...
Read more >
URL | Node.js v19.3.0 Documentation
A TypeError will be thrown if the input or base are not valid URLs. ... if urlObject.protocol is not undefined and is not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found