-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lessc can't find plugins when not in cwd(?) #3181
Comments
Does this happen only with the |
@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 |
@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. lessc -v after that enter: npm install less@2.7.1 -g |
`Unable to load plugin clean-css please make sure that it is installed under or at the same level as less Fatal error: Error running lessc on ...` Downgraded Less: less/less-plugin-clean-css#23 less/less.js#3181
@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. |
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:
The text was updated successfully, but these errors were encountered: