reactjscraco

How to use less in react


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


Solution

  • 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