0

我刚刚使用命令在 Ubuntu 16.04 上安装了 localtunnel sudo 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

如何让它工作?

4

2 回答 2

0

尝试运行

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

它应该工作

更多信息:https ://github.com/localtunnel/localtunnel/issues/344

于 2020-07-24T11:06:27.060 回答
-1

尝试这个

但是我有debian

/etc/apt/sources.list :

deb http://security.debian.org/jessie/updates main contrib 非免费
deb-src http://security.debian.org/jessie/updates main contrib 非免费 deb http://ftp.it.debian .org/debian/ jessie main contrib 非免费 deb-src http://ftp.it.debian.org/debian/ jessie main contrib 非免费

易于清洁

apt-get 更新

apt-get 升级

apt-get -f 安装

dpkg--配置-a

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

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

apt-get install -y nodejs

npm install -g localtunnel

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

lt --port 80*

为我工作

于 2020-11-23T11:35:08.103 回答