我刚刚使用命令在 Ubuntu 16.04 上安装了 localtunnelsudo npm install -g localtunnel
,但在尝试执行它时出现错误。
$ 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
如何让它工作?
尝试运行
LT -H "https://serverless.social" -P 8080
它应该工作
有关更多信息:https://github.com/localtunnel/localtunnel/issues/344
试试这个
但我有 debian
/etc/apt/sources.list :
Deb http://security.debian.org/Jessie/updates main contribnon-free
deb-src http://security.debian.org/Jessie/updates main contrib 非自由 Deb http://ftp.it.debian.org/debian/Jessie Main Contrib Non-free Deb-SRC http://ftp.it.debian.org/debian/Jessie Main Contrib 非自由apt-get cleant
apt-get 更新
apt-get upgrade
apt-get -f install
dpkg--配置 -a
apt-get install --force-yes apt-transport-https lsb-release
卷曲 -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 --端口 80*
为我工作