英文:
How to start express server with node in react native app
问题
我尝试使用以下命令启动包含我的MySQL连接详细信息的服务器文件:sudo node server.js,但是我收到了以下错误信息:
DEPRECATED use https://github.com/pillarjs/path-to-regexp
start
{ Error: ER_NOT_SUPPORTED_AUTH_MODE: 客户端不支持服务器请求的身份验证协议;考虑升级MySQL客户端
at Handshake.Sequence._packetToError (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Handshake.ErrorPacket (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)
at Protocol._parsePacket (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket.<anonymous> (/home/pandat/Desktop/myapp/node_modules/mysql/lib/Connection.js:91:28)
at Socket.<anonymous> (/home/pandat/Desktop/myapp/node_modules/mysql/lib/Connection.js:525:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
--------------------
at Protocol._enqueue (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Protocol.handshake (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at Connection.connect (/home/pandat/Desktop/myapp/node_modules/mysql/lib/Connection.js:119:18)
at Object.<anonymous> (/home/pandat/Desktop/myapp/server.js:19:5)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
code: 'ER_NOT_SUPPORTED_AUTH_MODE',
errno: 1251,
sqlMessage: '客户端不支持服务器请求的身份验证协议;考虑升级MySQL客户端',
sqlState: '08004',
fatal: true }
英文:
I tried to start my server file that contains my MySQL connection details with command sudo node server.js but I got this error:
pandat@pandat:~/Desktop/myapp$ sudo node server.js
[sudo] password for pandat:
DEPRECATED use https://github.com/pillarjs/path-to-regexp
start
{ Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
at Handshake.Sequence._packetToError (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Handshake.ErrorPacket (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)
at Protocol._parsePacket (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket.<anonymous> (/home/pandat/Desktop/myapp/node_modules/mysql/lib/Connection.js:91:28)
at Socket.<anonymous> (/home/pandat/Desktop/myapp/node_modules/mysql/lib/Connection.js:525:10)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
--------------------
at Protocol._enqueue (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/Protocol.js:144:48)
at Protocol.handshake (/home/pandat/Desktop/myapp/node_modules/mysql/lib/protocol/Protocol.js:51:23)
at Connection.connect (/home/pandat/Desktop/myapp/node_modules/mysql/lib/Connection.js:119:18)
at Object.<anonymous> (/home/pandat/Desktop/myapp/server.js:19:5)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Function.Module.runMain (module.js:693:10)
code: 'ER_NOT_SUPPORTED_AUTH_MODE',
errno: 1251,
sqlMessage: 'Client does not support authentication protocol requested by server; consider upgrading MySQL client',
sqlState: '08004',
fatal: true }
答案1
得分: -1
使用以下命令安装:
npm install -g express-generator
英文:
use
npm install -g express-generator
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论