代码之家  ›  专栏  ›  技术社区  ›  Ziv Glazer

electron无法添加redux开发工具,未捕获异常:语法错误:严格模式下不允许使用八进制文字

  •  1
  • Ziv Glazer  · 技术社区  · 8 年前

    我试图将redux开发工具添加到我的项目中(这样我可以更好地使用ngrx 4)。

    1) 使用electron dev tools安装程序 electron dev tools installer

    electron doc about dev tools 本文中的示例展示了如何下载我所需要的redux开发工具

    我在一个离线环境中工作,在那里我可以将文件夹从不同的计算机带到我的项目所在的位置,但不能反过来。所以我想不出使用选项1的方法。所以我试着选择2。

    然后,在我的电子项目主。js,在app ready事件中的一部分代码中,我调用了:

    BrowserWindow.addDevToolsExtension(pathToReduxDevTools);
    

    当我使用electron启动应用程序时,在主进程中出现以下javascript错误:

    Uncaught Exception:
    *Path to the extension in my computer*
    
    SyntaxError: Octal literals are not alloeed in strict mode.
    at exports.runInThisContext
    at Module._compile
    at .... (more ats, I can't copy them all, but you get the idea)
    

    我在windows上使用electron 1.2.5,如果你要建议我更新我的electron版本,我不得不说我不能这样做,我在更新它时也有错误(没有连接到redux开发工具),我还问了一个问题 here

    更新 设法更新到最新的electron,仍然出现相同的问题

    1 回复  |  直到 8 年前
        1
  •  2
  •   Ziv Glazer    8 年前

    事实证明,我无意中下载了react-dev工具而不是redux-devtools:X,这个故事的寓意是在下载扩展之前仔细检查一下

    推荐文章