FG
๐Ÿ”Œ APIs & SDKsTwilio

I got : TypeError: url.URL is not a constructor running examples with my account parameters

Freshalmost 5 years ago
Mar 14, 20260 views
Confidence Score85%
85%

Problem

Hello, I tried to run several examples from https://www.twilio.com/docs/libraries/node and running code (with my account sid/token) [code block] I got error : `TypeError: url.URL is not a constructor ` I tried to debug this issue in Twilio.js:258 and found : https://prnt.sc/w79oys and ref to undefined element https://prnt.sc/w79pqi and I see ref 10 years old https://prnt.sc/w79q4s can it be reason of my error and why so ? I tried version of twilio 3.54.1 (latest) and 3.54.0 but I have the same error and the same data I see debugging... In my OS : [code block] Why so and how it can be fixed ? Thanks!

Error Output

error :
`TypeError: url.URL is not a constructor  

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Moderate Confidence Fix
84% confidence100% success rate2 verificationsLast verified Mar 14, 2026

Solution: I got : TypeError: url.URL is not a constructor running examples with my account parameters

Low Risk

Hi @karthik22061993 Our library does not currently support node: 15.5.0. Please see here for the node versions we support. I would start off by verifying that you are running a supported node version that includes the `URL` class, which has been available since Node v6.13.0 (reference). Also check out issue 577 it looks like this error is related to defunctzombie/node-url#37.

84

Trust Score

2 verifications

100% success
  1. 1

    Hi @karthik22061993

    Our library does not currently support node: 15.5.0. Please see here for the node versions we support. I would start off by verifying that you are running a supported node version that includes the `URL` class, which has been available since Node v6.13.0 (reference). Also check out issue 577 it looks like this error is related to defunctzombie/node-url#37.

Validation

Resolved in twilio/twilio-node GitHub issue #639. Community reactions: 1 upvotes.

Verification Summary

Worked: 2
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

twiliosmsapitype:-getting-startedstatus:-waiting-for-feedback