/usr/lib/node_modules/@serverless-devs/s/lib/index.js:6936
} catch {
^
SyntaxError: Unexpected token {
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/lib/node_modules/@serverless-devs/s/bin/s:2:1)
解决了,升级一下node的版本就可以了
v6.17.1
[root@iZuf61ufxe31hylxifxl3oZ node]# npm install -g n
/usr/bin/n -> /usr/lib/node_modules/n/bin/n
/usr/lib
└── n@7.3.1
[root@iZuf61ufxe31hylxifxl3oZ node]# n latest
installing : node-v16.6.1
mkdir : /usr/local/n/versions/node/16.6.1
fetch : https://nodejs.org/dist/v16.6.1/node-v16.6.1-linux-x64.tar.xz
installed : v16.6.1 (with npm 7.20.3)
Note: the node command changed location and the old location may be remembered in your current shell.
old : /usr/bin/node
new : /usr/local/bin/node
To reset the command location hash either start a new shell, or execute PATH="$PATH"
[root@iZuf61ufxe31hylxifxl3oZ node]#
[root@iZuf61ufxe31hylxifxl3oZ node]# PATH="$PATH"
[root@iZuf61ufxe31hylxifxl3oZ node]#
[root@iZuf61ufxe31hylxifxl3oZ node]# node -v
v16.6.1
[root@iZuf61ufxe31hylxifxl3oZ node]# s -v
local version : 2.0.72
☁️ remote version : 2.0.72
[root@iZuf61ufxe31hylxifxl3oZ node]#
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。