尝试迁移在节点js中使用seguelizeCLI创建的表时出错,当我更改节点js的版本时,我也得到了不同的错误消息
1.当我使用稳定节点v9时
TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be one of type string, TypedArray, or DataView
at Hash.update (internal/crypto/hash.js:53:11)
at sha1 (/home/dontito/NodeORMs/node_modules/mysql2/lib/auth_41.js:30:8)
at Object.token [as calculateToken] (/home/dontito/NodeORMs/node_modules/mysql2/lib/auth_41.js:64:16)
at new HandshakeResponse (/home/dontito/NodeORMs/node_modules/mysql2/lib/packets/handshake_response.js:28:24)
at ClientHandshake.sendCredentials (/home/dontito/NodeORMs/node_modules/mysql2/lib/commands/client_handshake.js:51:27)
at ClientHandshake.handshakeInit (/home/dontito/NodeORMs/node_modules/mysql2/lib/commands/client_handshake.js:142:10)
at ClientHandshake.Command.execute (/home/dontito/NodeORMs/node_modules/mysql2/lib/commands/command.js:40:20)
at Connection.handlePacket (/home/dontito/NodeORMs/node_modules/mysql2/lib/connection.js:502:28)
at PacketParser.onPacket (/home/dontito/NodeORMs/node_modules/mysql2/lib/connection.js:81:16)
at PacketParser.executeStart (/home/dontito/NodeORMs/node_modules/mysql2/lib/packet_parser.js:77:14)
at Socket.<anonymous> (/home/dontito/NodeORMs/node_modules/mysql2/lib/connection.js:89:29)
at Socket.emit (events.js:127:13)
at addChunk (_stream_readable.js:269:12)
at readableAddChunk (_stream_readable.js:256:11)
at Socket.Readable.push (_stream_readable.js:213:10)
at TCP.onread (net.js:590:20)
2.when i turn to other node version like v4
crypto.js:100
this._handle.update(data, encoding);
^
TypeError: Not a string or buffer
at TypeError (native)
at Hash.update (crypto.js:100:16)
at sha1 (/home/dontito/NodeORMs/node_modules/mysql2/lib/auth_41.js:30:8)
at Object.token [as calculateToken] (/home/dontito/NodeORMs/node_modules/mysql2/lib/auth_41.js:64:16)
at new HandshakeResponse (/home/dontito/NodeORMs/node_modules/mysql2/lib/packets/handshake_response.js:28:24)
at ClientHandshake.sendCredentials (/home/dontito/NodeORMs/node_modules/mysql2/lib/commands/client_handshake.js:51:27)
at ClientHandshake.handshakeInit (/home/dontito/NodeORMs/node_modules/mysql2/lib/commands/client_handshake.js:142:10)
at ClientHandshake.Command.execute (/home/dontito/NodeORMs/node_modules/mysql2/lib/commands/command.js:40:20)
at Connection.handlePacket (/home/dontito/NodeORMs/node_modules/mysql2/lib/connection.js:502:28)
at PacketParser.onPacket (/home/dontito/NodeORMs/node_modules/mysql2/lib/connection.js:81:16)
at PacketParser.executeStart (/home/dontito/NodeORMs/node_modules/mysql2/lib/packet_parser.js:77:14)
at Socket.<anonymous> (/home/dontito/NodeORMs/node_modules/mysql2/lib/connection.js:89:29)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at readableAddChunk (_stream_readable.js:146:16)
at Socket.Readable.push (_stream_readable.js:110:10)
at TCP.onread (net.js:523:20)
答案 0 :(得分:0)
您应该在abc→“ abc”这样的配置文件中更改密码