Running Less.js for windows with Clean-Css enabled get "object has no method 'install' error

1.8k views Asked by At

I am using the following git:less.js-windows. I've installed clean-css with the following command:

npm install -g less-plugin-clean-css

now I am trying to run lessc with this:

lessc -clean-css main.less main.css

and I get the following error:

TypeError: Object # has no method 'install' at PluginManager.addPlugin (C:\Users\oscar.polo\Downloads\less.js-windows-v2.1.1\bin\node_modules\less\lib\less\plugin-manager.js:28:12) at PluginManager.addPlugins (C:\Users\oscar.polo\Downloads\less.js-windows-v2.1.1\bin\node_modules\less\lib\less\plugin-manager.js:18:18) at Object.render (C:\Users\oscar.polo\Downloads\less.js-windows-v2.1.1\bin\node_modules\less\lib\less\render.js:31:27) at C:\Users\oscar.polo\Downloads\less.js-windows-v2.1.1\bin\node_modules\less\lib\less\render.js:18:24 at doResolve (C:\Users\oscar.polo\Downloads\less.js-windows-v2.1.1\bin\node_modules\promise\lib\core.js:91:5) at new Promise (C:\Users\oscar.polo\Downloads\less.js-windows-v2.1.1\bin\node_modules\promise\lib\core.js:71:3) at Object.render (C:\Users\oscar.polo\Downloads\less.js-windows-v2.1.1\bin\node_modules\less\lib\less\render.js:17:20) at parseLessFile (C:\Users\oscar.polo\Downloads\less.js-windows-v2.1.1\bin\node_modules\less\bin\lessc:381:10) at evalmachine.:266:14 at C:\Users\oscar.polo\Downloads\less.js-windows-v2.1.1\bin\node_modules\graceful-fs\graceful-fs.js:102:5

Any ideas whats wrong?

2

There are 2 answers

0
Ihor On

I'm not sure will it help, but try to do this:

lessc --clean-css main.less main.css

Because based on documentation usage it should be run with double dash before parameter "clean-css"

0
Ihor On

Parameter --clean-css means that *.css file will be compressed using clean-css tool. Maybe you have no it installed? Try this to install it:

npm install -g less-plugin-clean-css

This may help you: Clean CSS