user1457366
user1457366

Reputation: 669

Error: 'cleancss' is not a recognized as an internal or external

I just installed clean-css (https://github.com/GoalSmashers/clean-css) via npm command line and I would like to use it to concatenate and minify some css files (duh). However, I am getting this error:

'cleancss' is not a recognized as an internal or external command, operable program or batch file.

I am new to doing things from the command line so this completely throws me for a loop. I couldn't find an answer to this clean-css specific issue. The general answer for this type of error seems to be that the environment variables need to by updated but while I have done that in the past to point to certain executable files I am not sure what I would have to do in this particular scenario. Any takers?

Upvotes: 0

Views: 3114

Answers (2)

Ange
Ange

Reputation: 121

I was experiencing this problem and, as of 4.0, clean-css-cli needs to be installed. I take no credit I merely found the answer here: https://stackoverflow.com/a/41912485

Upvotes: 5

MichaelMilom
MichaelMilom

Reputation: 3067

Try installing in with

npm install -g clean-css

Using the global option should make it available in your shell.

Upvotes: 4

Related Questions