I have encountered a weird behaviour. When I use the less command line tool with a path it doesn't detect that the css-clean plugin is installed. Whereas when I use it in the folder where the node_modules are placed it works. See image:
Does this happen only with the clean-css
plugin or ...?
@seven-phases-max Seems to be plugin independant.
I just started getting the above autoprefix error myself. I haven't touched my code in weeks.
Bug was introduced in v3.x, so I had to downgrade to less 2.7.3
I _just_ made the same discovery and fix. I didn't notice 3.x was out due to how the Releases page looked.
@seven-phases-max it seems to be all plugins
I was in version 3.0.1 and it is not working. Just do this to solve.
See your lessc version:
lessc -v
after that enter:
npm install [email protected] -g
@seven-phases-max Any plan to fix this?
@Franziskus1988 If you or anyone else would like to submit a PR for this, that would be welcome.
@matthew-dean I've tried to fix it. Unfortunatelly the "failing import" test is failing. I don't know if there is a more convenient way to find the root folder of the node_modules installation. The test is now failing because I'm using a path which is relative to the less-node/index.js script position. In a node installation it works, but in the test enviroment it resolves to the wrong location. I could do an ugly fix for the test, but I actually don't know how to fix it nicely.
I think the problem is that process.cwd()/node_modules is added as path, although it should point to the node_modules folder of the less installation. Since process.cwd() always resolves to the current location in terminal the plugins, which are installed in the same package as less aren't found.
@Franziskus1988 Please see #3200.
Most helpful comment
Bug was introduced in v3.x, so I had to downgrade to less 2.7.3