I am on a Windows 7 box, and I recently installed the most recent version of Node from NodeJS.org
I then ran...
C:\Users\jcreamer>npm install -g uglify-js
npm http GET https://registry.npmjs.org/uglify-js
npm http 304 https://registry.npmjs.org/uglify-js
C:\Users\jcreamer\AppData\Roaming\npm\uglifyjs -> C:\Users\jcreamer\AppData\Roaming\npm\node_modules\uglify-js\bin\uglifyjs
[email protected] C:\Users\jcreamer\AppData\Roaming\npm\node_modules\uglify-js
And restarted command prompt, but I still cannot run...
cd c:\inetpub\wwwroot\app\
node uglifyjs -o app.min.js app.js
I get this error...
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'C:\Inetpub\wwwroot\analytics\uglifyjs'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
Is there something else I need to do?
UPDATE
Even after I ran the npm as administartor, if I run
C:\Users\jcreamer>uglifyjs
I get...
C:\Users\jcreamer>"C:\Users\jcreamer\AppData\Roaming\npm\\.\node_modules\uglify-js\bin\uglifyjs"
'"C:\Users\jcreamer\AppData\Roaming\npm\\.\node_modules\uglify-js\bin\uglifyjs"' is not recognized as an internal or external comm
and,
operable program or batch file.
If you have Windows, Then use the following command
npm -g install uglify-js
the -g
flag indicates that this is a global installation and will set the env path.
Working for me. Let me know if it is working for you as well.