首页 > 解决方案 > Python3 Odoo TypeError sys.print 不是函数

问题描述

我刚刚设置了 Odoo 的全新安装(没有自定义插件/模块),在创建数据库后,我在主页上收到此错误:


The style compilation failed, see the error below. Your recent actions may be the cause, please try reverting the changes you made.

(b'', b'TypeError: sys.print is not a function
    at /usr/lib/nodejs/less/bin/lessc:384:25
    at tree.importVisitor.finish [as _finish] (/usr/lib/nodejs/less/lib/less/parser.js:669:28)
    at tree.importVisitor.run (/usr/lib/nodejs/less/lib/less/import-visitor.js:25:22)
    at Object.parse (/usr/lib/nodejs/less/lib/less/parser.js:675:22)
    at parseLessFile (/usr/lib/nodejs/less/bin/lessc:345:12)
    at Socket. (/usr/lib/nodejs/less/bin/lessc:407:9)
    at Socket.emit (events.js:228:7)
    at endReadableNT (_stream_readable.js:1185:12)
    at processTicksAndRejections (internal/process/task_queues.js:81:21)
')This error occured while compiling the bundle 'web.assets_common' containing:
    - /web/static/lib/bootstrap/less/variables.less
    ....

在对谷歌进行了一些研究之后,我已经尝试过:

我的版本:

NodeJs v12.14.1

Npm 6.13.4

少@3.11.1

less-plugin-clean-css@1.5.1

正如我所看到的,这不是一个常见的错误,并且没有很好地记录在这种情况下该怎么做。有人见过类似的东西吗?

标签: pythonnode.jslessodoo

解决方案


我最近在 Ubuntu 18.04 上遇到了与 Odoo 11 类似的错误,我安装了 less apt install node-less(安装了 lessc 1.6.3)。改为安装 less npm install -g less(npm 6.13.4,nodejs 12.16.1,安装 lessc 3.11.1)使其工作。

奇怪的是你说你已经有了lessc 3.11.1。也许尝试完全删除并使用 npm 安装它。


推荐阅读