V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
FlowerChen
V2EX  ›  问与答

求 Node 大神帮忙, global is not defined 解决方法

  •  
  •   FlowerChen · Apr 18, 2017 · 5343 views
    This topic created in 3307 days ago, the information mentioned may be changed or developed.

    菜鸟一枚毕业设计要用 node-webkit 写一个东西,从网上拷了别人的项目,然后运行时一只提示 Uncaught ReferenceError: global is not defined ; 报错地方代码:

    <script type="text/javascript"> global.window = window; global.$ = $; // 加载 nw.gui 模块 global.gui = require('nw.gui'); hljs.initHighlightingOnLoad(); init(); </script>
    1 replies    2017-04-19 07:53:54 +08:00
    tinyproxy
        1
    tinyproxy  
       Apr 19, 2017 via iPhone
    https://github.com/nwjs/nw.js/wiki/Differences-of-JavaScript-contexts

    我记得有 workaround 的方法,不行的话开 issue 问问 Roger
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1574 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 357ms · UTC 16:44 · PVG 00:44 · LAX 09:44 · JFK 12:44
    ♥ Do have faith in what you're doing.