0

I've just installed localtunnel on a Ubuntu 16.04 using the command sudo npm install -g localtunnel, but getting an error when try to execute it.

$ lt --port 8080
/usr/local/lib/node_modules/localtunnel/bin/lt.js:8
const { version } = require('../package');
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3
$ npm -version
3.5.2
$ lt --help
/usr/local/lib/node_modules/localtunnel/bin/lt.js:8
const { version } = require('../package');
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3

How to get it working ?

Kleyson Rios
  • 2,597
  • 5
  • 40
  • 65

2 Answers2

0

try running

lt -h "https://serverless.social" -p 8080

it should work

for more information: https://github.com/localtunnel/localtunnel/issues/344

-1

try This

But I have debian

/etc/apt/sources.list :

deb http://security.debian.org/ jessie/updates main contrib non-free
deb-src http://security.debian.org/ jessie/updates main contrib non-free deb http://ftp.it.debian.org/debian/ jessie main contrib non-free deb-src http://ftp.it.debian.org/debian/ jessie main contrib non-free

apt-get clean

apt-get update

apt-get upgrade

apt-get -f install

dpkg--configure -a

apt-get install --force-yes apt-transport-https lsb-release

curl -sL https://deb.nodesource.com/setup_8.x | bash -

apt-get install -y nodejs

npm install -g localtunnel

ln -s /usr/bin/nodejs /usr/bin/node

lt --port 80*

Works for me