【问题标题】:FB CTF - SyntaxError: Grunt is not generating JS FilesFB CTF - SyntaxError: Grunt 没有生成 JS 文件
【发布时间】:2020-10-12 22:45:16
【问题描述】:

安装产品:https://github.com/facebookarchive/fbctf/wiki/Installation-Guide,-Production

这是我尝试通过任何给定方法(直接、docker 和 vagrant)安装时收到的错误消息:

[+] 运行 grunt 生成 JS 文件 /var/www/fbctf/node_modules/grunt-legacy-log-utils/node_modules/chalk/source/index.js:106 ...风格, ^^^

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> (/var/www/fbctf/node_modules/grunt-legacy-log-utils/index.js:12:13)

【问题讨论】:

    标签: javascript node.js facebook gruntjs


    【解决方案1】:

    试试看

    -> # apt remove nodejs
    -> # curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
    -> # sudo apt-get install -y nodejs
    

    可能,如果不是12版,就会出现错误

    【讨论】:

      【解决方案2】:

      在 Windows 上安装最新版本的 node.js,错误应该会消失。

      【讨论】:

        【解决方案3】:

        正在努力建立 FBCTF,试图到处搜索,但没有人能解决。自己找到了解决办法。

        nano package.json
        

        在 package.json 中,更改为

        "grunt": "^1.0.1",
        

         "grunt": "1.0.1",
        

        “^”似乎将 grunt 的版本更新为 1.3.0(撰写本文时),这显然与未维护 2 年的 FBCTF 不兼容。

        【讨论】:

          猜你喜欢
          • 2017-11-23
          • 2016-06-30
          • 2013-10-15
          • 2014-08-03
          • 2013-06-04
          • 2019-11-25
          • 1970-01-01
          • 1970-01-01
          • 2017-02-18
          相关资源
          最近更新 更多