I have created a .env file (should it have a name or just the extension?) In it I have placed my credentials:
TWILIO_ACCOUNT_SID=AC---------------------------
TWILIO_API_KEY=SK------------------------------
TWILIO_API_SECRET=-------------
I have installed the dotenv package from npm and this code works perfectly:
const dotenv = require('dotenv');
const result = dotenv.config()
if (result.error) {
throw result.error
}
console.log(result.parsed)
However, when I try and run the cli command: twilio phone-numbers:update "+xxxxxxxxxx" --sms-url="http://localhost:1337/sms"
It tells me:
Alternatively, twilio-cli can use credentials stored in environment variables:
# OPTION 1 (recommended)
TWILIO_ACCOUNT_SID = your Account SID from twil.io/console
TWILIO_API_KEY = an API Key created at twil.io/get-api-key
TWILIO_API_SECRET = the secret for the API Key
Trying to use the cli as recommended in the tutorials to update the webhook for my number and run ngrok automatically. Any ideas why the cli wouldn't be seeing the values in the .env when they are clearly accessible in a script via dotenv?