You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows环境下Odoo 10安装报错:could not execute command 'lessc' 求助

Fixing "could not execute command 'lessc'" in Odoo 10 on Windows

Hey there, I’ve dealt with this exact issue on Windows before—let’s get it sorted out step by step. The error pops up because Odoo relies on the lessc compiler (part of the LESS CSS preprocessor) to render styles, but it can’t locate the command in your system’s PATH. Here’s how to fix it:

  • First, install Node.js
    lessc is a Node.js package, so you’ll need Node installed first. Grab the LTS version (the most stable pick for Odoo 10) from the official Node.js site. When going through the installer, make sure to check the box labeled "Add to PATH"—this is critical for your system to find Node and its tools later.

  • Install the less package globally
    Open Command Prompt (CMD) or PowerShell (you don’t need admin rights unless you hit permission snags), then run this command:

    npm install -g less
    

    The -g flag installs it system-wide, so lessc will be accessible anywhere on your machine.

  • Verify the installation
    Stay in your terminal and run:

    lessc -v
    

    If you see a version number show up, you’re good to go—lessc is now installed and detectable.

  • Restart Odoo
    Changes to your system’s PATH won’t take effect in already running programs. Close your Odoo server window completely, then fire it up again. The error should be gone at this point.

  • If it still doesn’t work: Check your PATH manually
    Sometimes the Node installer misses adding necessary paths to your system PATH. Here’s how to fix that:

    1. Right-click This PC → Properties → Advanced system settings → Environment Variables.
    2. Under System Variables, find the Path variable and click Edit.
    3. Make sure these two paths are listed (replace [YourUsername] with your actual Windows username):
      • C:\Program Files\nodejs\
      • C:\Users\[YourUsername]\AppData\Roaming\npm\
    4. If either is missing, add them, click OK to save all changes, then restart your computer and try Odoo again.
  • Bonus: Use a compatible less version
    If you run into odd styling issues even after fixing the error, Odoo 10 works best with less version 2.7.3. Install that specific version with:

    npm install -g less@2.7.3
    

内容的提问来源于stack exchange,提问作者Ffs

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 03:26:40