jcreamer898
jcreamer898

Reputation: 8189

Using uglifyjs with nodejs in windows

I installed nodejs from nodejs.org on my windows box.

The path to node is C:\Program Files (x86)\nodejs\node.exe

I can run node in command prompt correctly, my question is...I cloned uglifyjs to C:\gitrepos\uglifyjs\

Now I am trying to figure out how to get things setup to just run something like

node uglifyjs -o inputfile.min.js inputfile.js

What has to happen to allow me to do that?

Upvotes: 12

Views: 18257

Answers (3)

Joberror
Joberror

Reputation: 5890

For you to run any NodeJS app in any environment(folder). Do the following

  1. Install the app globally

    npm install uglify-js -g 
    
  2. Exit and re-open the command prompt

  3. Run uglifyJS without node command

    uglifyjs [options] filename
    

Upvotes: 52

Scott
Scott

Reputation: 724

You could just add the C:\gitrepos\uglifyjs\bin path to your...path environment variable.

Upvotes: 3

pradeek
pradeek

Reputation: 22105

You can run it by :

node C:\gitrepos\uglifyjs\bin\uglifyjs -o inputfile.min.js inputfile.js

Upvotes: 11

Related Questions