簡體   English   中英

Python3 Odoo TypeError sys.print 不是函數

[英]Python3 Odoo TypeError sys.print is not a function

我剛剛設置了全新安裝的 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 要求

  • 每次嘗試后刪除我的數據庫

  • 將 Less 降級到 1.3.3

我的版本:

NodeJs v12.14.1

新版 6.13.4

少@3.11.1

less-plugin-clean-css@1.5.1

正如我所見,這不是一個常見的錯誤,並且沒有很好地記錄在這種情況下該怎么做。 有人見過類似的東西嗎?

我最近在 Ubuntu 18.04 上使用 Odoo 11 遇到了類似的錯誤,我使用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 安裝它。

從引導程序安裝推薦的構建依賴項,

命令 - npm install -g less jshint 凹進 uglify-js

謝謝

嘗試使用npm install -g --force less less-plugin-clean-css
從 Odoo 10 升級到 11 時,我遇到了類似的問題,在 Ubuntu 20.4 上,我嘗試運行
sudo npm install -g less less-plugin-clean-css
如果安裝了無節點,這會帶來錯誤,但是在嘗試標記--force它安裝時沒有任何錯誤,Odoo 運行正常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM