TypeError:参数.平坦不是一个函数


Listening on port 3000
/backend/node_modules/ioredis/built/Command.js:43
        this.args = args.flat();
                         ^
TypeError: args.flat is not a function
    at new Command (/Users/apple/Desktop/bbs-backend/node_modules/ioredis/built/Command.js:43:26)
    at EventEmitter.info (/Users/apple/Desktop/bbs-backend/node_modules/ioredis/built/utils/Commander.js:92:13)
    at EventEmitter._readyCheck (/Users/apple/Desktop/bbs-backend/node_modules/ioredis/built/Redis.js:623:14)
    at Socket.<anonymous> (/Users/apple/Desktop/bbs-backend/node_modules/ioredis/built/redis/event_handler.js:58:18)
    at Object.onceWrapper (events.js:273:13)
    at Socket.emit (events.js:187:15)
    at Socket.EventEmitter.emit (domain.js:442:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1099:10)
  1. 重新安装npm packages &重启redis服务器-不工作

我正在使用节点v10.11.0在当时。在我将Node更新到v12.18.4之后现在一切都很好。

实际上是当前节点版本导致的,所以请升级当前节点版本。要进行更新,您可以在终端上运行以下命令:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
source ~/.bashrc
nvm list-remote
nvm install v14.17.6
$ sudo npm install -g n

相关内容

  • 没有找到相关文章

最新更新