开发者社区> 问答> 正文

执行s -v报错

/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)

展开
收起
1331638917900276 2021-08-05 10:22:35 650 0
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]# 
    
    2021-08-05 10:29:05
    赞同 展开评论 打赏
问答分类:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载