Skip to content

"'global' is undefined" running prettydiff.js from node.js commandline in Windows #381

Description

@rprastein

I'm no javascript developer and I'm just looking for a commandline XML beautifier, and this looked promising. I downloaded the project (complete with all of the libraries), found and installed node.js, read the documentation and examples, and tried the following syntax:
prettydiff source:"samples.xhtml" mode:"beautify"
from within the directory containing prettydiff.js

I'm getting a Windows Script Host error popup that states,
Script: C:...\prettydiff.js
Line: 90
Char: 5
Error: 'global is undefined'
Code: 800A1391
Source: Microsoft JScript runtime error.

Sure enough, looking at prettydiff.js, I don't see where global is defined. Am I supposed to be defining it somewhere?

Thanks,

Rebeccah

Activity

  1. rprastein commented on Oct 26, 2016

    @rprastein
    Author

    OK, I got it. This comment, in prettydiff.js, is misleading:

     Execute on command line with NodeJS:
    
        prettydiff source:"c:\mydirectory\myfile.js" readmethod:"file" diff:"c:\myotherfile.js"
    
    

    It probably should be this (at least for Windows):

     Execute on command line with NodeJS:
    
        node node-local.js source:"c:\mydirectory\myfile.js" readmethod:"file" diff:"c:\myotherfile.js"
    
    
  2. prettydiff commented on Oct 26, 2016

    @prettydiff
    Owner

    Thanks for letting me know. I will refine the documentation to be more clear.

  3. prettydiff commented on Nov 19, 2016

    @prettydiff
    Owner

    I will push updated documentation to branch 2.1.15 later today. In the mean time you can make the global installation an easy reality by installing Pretty Diff with biddle and then making it global:

    biddle install http://prettydiff.com/downloads/prettydiff/prettydiff_latest.zip
    biddle global prettydiff
    
  4. added a commit that references this issue on Dec 2, 2016
    d7aaa8d
  5. prettydiff commented on Dec 2, 2016

    @prettydiff
    Owner

    I will publish this mega-massive update this weekend, which will also include official support with biddle in production and closing of #291

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions