python - 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 链接到 /usr/bin 中的节点
重新安装 node-js、less-js、uglify-js
重新安装所有 pip3 Odoo 要求
每次尝试后删除我的数据库
降级到 1.3.3
我的版本:
NodeJs v12.14.1
Npm 6.13.4
少@3.11.1
less-plugin-clean-css@1.5.1
正如我所看到的,这不是一个常见的错误,并且没有很好地记录在这种情况下该怎么做。有人见过类似的东西吗?
解决方案
我最近在 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 安装它。
推荐阅读
- c# - 如何检查光标位置是否在windows窗体中的图表控件之外?
- laravel - BACKPACK Laravel 使用 Backpack CRUD 以多对多关系管理数据透视表中的额外列
- android - 在 RemoteViews 中调用 updateAppWidget 时出现 TransactionTooLargeException(仅在 android 7.0 和 6.0 上)
- json - Camel交换标头中的Json对象未正确转换为字符串
- java - 如何在 Selenium Java 中使用 CTRL + v 在输入字段中粘贴文本值?
- c# - 无法加载文件或程序集“Ninject”
- java - 用于在 Java 中保存访问令牌的线程安全类
- angular - 我正在尝试设置模板驱动表单的表单值,但出现如下错误:
- swift - 单击标签时如何显示另一个视图控制器
- android - 添加样式资源文件后,Android 资源链接失败