I installed clean-css locally but my npm script is throwing an error because cleancss is not found (sh: cleancss: command not found
).
I tried running cleancss straight from the command line and installed it globally (npm install -g clean-css
) but my shell still doesn't know about it. All other packages are working fine.
Here's what my package.json looks like:
{
"scripts": {
"lint": "echo '=> linting' && jshint **/*.js",
"minify:js": "echo '=> minify:js' && uglifyjs main.js -o public/js/main.min.js",
"minify": "echo '=> minify:css' && cleancss main.css -o public/css/main.min.css"
},
"devDependencies": {
"clean-css": "^4.0.2",
"jshint": "^2.9.4",
"uglify-js": "^2.7.5"
}
}
What am I missing?
From the clean-css docs:
You have only the API installed. You need to install the CLI. Run:
To uninstall the API-only version and install the CLI.