Emanuele Ciriachi
Emanuele Ciriachi

Reputation: 2274

Windows 7: npm uglifyjs "is not recognized as an internal or external command"

I installed npm 2.15.9, works fine anywhere when I open the Command Prompt.

I (allegedly) installed uglifyjs by typing

npm install -g uglifyjs

I tried with and without -g, and I ran it in the folder where I want to use it. Even after doing so and not receiving any error, typing "uglifyjs" or "node uglifyjs" in the CMD terminal return the standard error message - uglifyjs is not recognized as an internal or external command, operable program or batch file."

What am I doing wrong?

EDIT: yes, I tried closing and reopening the CMD window at each step.

Upvotes: 5

Views: 5363

Answers (2)

yagoogaly
yagoogaly

Reputation: 99

uglifyjs is deprecated - use uglify-js instead.

npm install -g uglify-js

Upvotes: 7

msanford
msanford

Reputation: 12247

  1. Does npm think it's installed? (npm ls -g | findstr uglify should reveal it).
  2. Try npm config get prefix and, with that path:
    • Is that that folder on your %PATH% (echo %PATH%)?
    • Is npm is actually installing the binaries in that folder (dir C:\Users\emanuelec\AppData\Roaming\npm).

It does seem to that 'bin links' are being generated (from your comment above, C:\Users\emanuelec\AppData\Roaming\npm\uglifyjs), so I suspect the npm\ folder is not in your path, or is being clobbered by something.

Upvotes: 2

Related Questions