Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use less in react

Tags:

reactjs

craco

I want to use less in react18, before that I installed and configured "@craco/craco", but when executing "npm i craco-less -D", the console prompts an error, I searched a lot without finding it, looking forward to your reply!

Console error reporting: console error

package.json enter image description here

craco.config.js enter image description here

like image 743
xu Han Avatar asked May 28 '26 14:05

xu Han


1 Answers

Try to install it using the --force flag, like:

npm install craco-less --save-dev --force

Or for short:

npm i craco-less -D -f
like image 182
Kevin M. Mansour Avatar answered May 31 '26 09:05

Kevin M. Mansour