Meteor 构建的 Wekan 代码无法在 Node 0.10.4x 中运行, Meteor 将为新版本 Node 创建代码,例如 const 或 lambda 表达式。 如何让 Meteor 构建可以在 Node 0.10.4x 中运行的代码?
错误1:
/home/wekan/output/bundle/programs/server/packages/modules.js:33433
const Boom = require(‘boom’);
^^^^^
SyntaxError: Use of const in strict mode.
at /home/wekan/output/bundle/programs/server/boot.js:292:30
at Array.forEach (native)
at Function..each..forEach (/home/wekan/output/bundle/programs/server/node_modules/underscore/underscore.js:79:11)
at /home/wekan/output/bundle/programs/server/boot.js:133:
错误2:
/home/wekan/output/bundle/programs/server/packages/modules.js:33571
credentialsFunc(attributes.id, (err, credentials) => {
^Preformatted text
SyntaxError: Unexpected token >
at /home/wekan/output/bundle/programs/server/boot.js:292:30
at Array.forEach (native)
at Function..each..forEach (/home/wekan/output/bundle/programs/server/node_modules/underscore/underscore.js:79:11)
at /home/wekan/output/bundle/programs/server/boot.js:133:5
最佳答案
根据 Wekan 文档 https://github.com/wekan/wekan/wiki/Install-and-Update
If you haven't already, you need to install Node.js, given that we need node version 4.8.4, make sure to either use the custom packages (the ones of your OS are likely too old) or install the correct version from the Node.js website.
Node 0.10.4 已经很老了,我不知道为什么你还在使用它。如果你想在你的机器上管理不同版本的 Node ,你可以使用像 nvm 这样的东西。
关于javascript - 如何询问 Meteor 为旧的 Nodejs 构建代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46590500/