Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

269
Visualizações
twilio error "accountSid must start with AC"
const express = require("express");
const app = express();
const PORT = 3000;
require("dotenv").config();
const accountSid = process.env.TWILIO_ACCOUNT_SID;
const authToken = process.env.TWILIO_TOKEN;
const client = require("twilio")(accountSid, authToken);

client.messages
  .create({
    to: process.env.NUMBER,
    from: "+18598006707",
    body: "Hello Kashif",
  })
  .then((message) => console.log(message.sid));

app.listen(PORT, () => {
  console.log("server is at", PORT);
});

i am getting "accountSid must start with AC" even though my TWILIO_ACCOUNT_SID include AC.

TWILIO_ACCOUNT_SID="ACa6213af064b**************";
TWILIO_TOKEN="b5e1f89ed92c7c5****************";
NUMBER="+91783******";
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Can I assume the second code snippet you shared is your .env file? If so, the .env file does not support semicolons. If I put semicolons in my .env file and run your script, I get the same error as you. Try updating your .env file like this:

TWILIO_ACCOUNT_SID="ACa6213af064b**************"
TWILIO_TOKEN="b5e1f89ed92c7c5****************"
NUMBER="+91783******"

Once I did that, it started working for me. To confirm whether your .env file is loaded correctly, you can try logging accountSid and other variables from process.env, and verify it matches your .env file values.

about 4 years ago · Juan Pablo Isaza Relatório

0

Another cause for the above error can be the variables in .env file being ahead or behind of the variable values in your terminal, in which case it can be resolved by running source .env.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda