错误:'cleancss'不被识别为内部或外部

时间:2013-11-25 05:02:26

标签: css node.js command-line npm

我刚刚通过npm命令行安装了clean-css(https://github.com/GoalSmashers/clean-css),我想用它来连接和缩小一些css文件(duh)。但是,我收到了这个错误:

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

我是新手从命令行做事情所以这完全抛弃了我的循环。我无法找到这个清洁CSS特定问题的答案。这种类型的错误的一般答案似乎是环境变量需要更新,但是我在过去做过那些指向某些可执行文件时我不确定在这个特定场景中我将不得不做什么。任何人?

2 个答案:

答案 0 :(得分:4)

尝试使用

安装
npm install -g clean-css

使用全局选项应该可以在shell中使用。

答案 1 :(得分:2)

我遇到了这个问题,从4.0开始,需要安装clean-css-cli。我不相信我只是在这里找到答案: https://stackoverflow.com/a/41912485