Home > Software design >  TypeError: args.flat is not a function
TypeError: args.flat is not a function

Time:11-09

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. reinstall npm packages & restart redis server - not working

CodePudding user response:

I was use node v10.11.0 at the time. After I updated Node to v12.18.4, everything is now in working good.

CodePudding user response:

Actually it is caused by your current node version so,please upgrade your current node version.To update, you can run following command on your terminal .

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
  • Related