typpo / textbelt

Free API for outgoing SMS
https://textbelt.com/
MIT License
3.07k stars 519 forks source link

TypeError: text.debug is not a function #96

Closed pgibler closed 7 years ago

pgibler commented 7 years ago

I have a Vagrant box that I'm bootstrapping with a bash script to setup a standalone textbelt server.

All dependencies and executables get installed correctly, but when I attempt to run textbelt, I get the following error:

vagrant@textbelt-box:/var/www/textbelt-machine$ /opt/textbelt/textbelt-master/server/app.js:30
text.debug(true);
     ^

TypeError: text.debug is not a function
    at Object.<anonymous> (/opt/textbelt/textbelt-master/server/app.js:30:6)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:420:7)
    at startup (bootstrap_node.js:139:9)
    at bootstrap_node.js:535:3
pgibler commented 7 years ago

This is my bash script, if that helps at all. I'm running Ubuntu 16.04.

#!/usr/bin/env bash

# TextBelt user.
USER=$1

# Application directory.
TEXTBELT_DIR=/opt/textbelt/

# Update apt-get.
sudo apt-get -y update

# Install redis dependencies.
sudo apt-get -y install build-essential tcl

# Install redis.
sudo apt-get -y install redis-server

# Start redis-server
redis-server start &

# Don't interact with mutt.
DEBIAN_FRONTEND=noninteractive

# Install mutt.
sudo apt-get -y install mutt

# Install a local nginx for reverse proxy / load balancing and IP rate limiting.
sudo apt-get install -y nginx

# Screen is just useful.
sudo apt-get install -y screen

# Need unzip.
sudo apt-get -y install unzip

# Install nodejs.
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs

USER=vagrant

# Application directory.
TEXTBELT_DIR=/opt/textbelt/

# Install textbelt.
HOME=$TEXTBELT_DIR
sudo mkdir -p $TEXTBELT_DIR
sudo chmod 777 $TEXTBELT_DIR
sudo usermod -a -G www-data $USER 
cd $TEXTBELT_DIR
wget https://github.com/typpo/textbelt/archive/master.zip
unzip master.zip
cd textbelt-master
touch server/torlist
npm install

nodejs server/app.js &  
typpo commented 7 years ago

Sorry for the trouble - we just refactored some code and this slipped through.

pgibler commented 7 years ago

No worries at all. Good to know you are one step ahead!

Is the current head revision of git good to go for running the standalone server?

pgibler commented 7 years ago

Answered my own question - that call is fixed in the master branch so I shouldn't see this issue

https://github.com/typpo/textbelt/blob/master/server/app.js#L31