我按照网上的方法修改了,然后npm run dev
没有问题,但是node ./bin/www.js
就报错了,还是那个not support的错误。
node ./bin/www.js
执行结果:
~/coding/nodejs/node-blog node ./bin/www.js
Listening on 8000
/Users/zhengjihan/coding/nodejs/node-blog/node_modules/mysql/lib/protocol/Parser.js:437
throw err; // Rethrow non-MySQL errors
^
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
at Handshake.Sequence._packetToError (/Users/zhengjihan/coding/nodejs/node-blog/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Handshake.ErrorPacket (/Users/zhengjihan/coding/nodejs/node-blog/node_modules/mysql/lib/protocol/sequences/Handshake.js:123:18)
at Protocol._parsePacket (/Users/zhengjihan/coding/nodejs/node-blog/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/Users/zhengjihan/coding/nodejs/node-blog/node_modules/mysql/lib/protocol/Parser.js:433:10)
npm run dev
执行结果:
~/coding/nodejs/node-blog npm run dev
> blog@1.0.0 dev
> cross-env NODE_ENV=dev nodemon --inspect=9229 ./bin/www.js
[nodemon] 2.0.7
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node --inspect=9229 ./bin/www.js`
Debugger listening on ws://127.0.0.1:9229/ab31438d-0e98-4a93-b97b-12ca3eedae9e
For help, see: https://nodejs.org/en/docs/inspector
Listening on 8000
这是为什么呢?