Ошибка осталась
Вопросы.
1. При установке поле "Automatically install the necessary tools" нужно активировать?
2. Может комп перезагружать нужно до(после) удаления(установки)?
Детали.
Cообщение об ошибке.
E:\>cd e:\Test\Pro01\
e:\Test\Pro01>node app.js
Start at http://localhost:3000
You have tried to call .then(), .catch(), or invoked await on the result of query that is not a promise,
which is a programming error.
Try calling con.promise().query(), or require('mysql2/promise') instead of 'mysql2'
for a promise-compatible version of the query interface.
To learn how to use async/await or Promises
check out documentation at https://www.npmjs.com/package/mysql2...romise-wrapper,
or the mysql2 documentation at https://github.com/sidorares/node-my...ise-Wrapper.md
e:\Test\Pro01\node_modules\mysql2\lib\commands\que ry.js:41
throw new Error(err);
^
Error: You have tried to call .then(), .catch(), or invoked await on the result of query that is not a promise, which is a programming error. Try calling con.promise().query(), or require('mysql2/promise') instead of 'mysql2' for a promise-compatible version of the query interface. To learn how to use async/await or Promises check out documentation at https://www.npmjs.com/package/mysql2...romise-wrapper, or the mysql2 documentation at https://github.com/sidorares/node-my...ise-Wrapper.md
at Query.then (e:\Test\Pro01\node_modules\mysql2\lib\commands\qu ery.js:41:11)
at MySQLStore.query (e:\Test\Pro01\node_modules\express-mysql-session\index.js:392:12)
at MySQLStore.<anonymous> (e:\Test\Pro01\node_modules\express-mysql-session\index.js:110:9)
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
e:\Test\Pro01>node -v
v16.16.0
e:\Test\Pro01>
Выполнил:
- Удалил Node.js v18.7.0;
- Скачал Latest LTS Version: 16.16.0.
https://nodejs.org/en/download/;
- Запустил установщик node-v16.16.0-x64.msi;
Во время установки Node поле:
"Automatically install the necessary tools. Note that this will also install Chocolatey. The
script will pop-up in a new window after the installation completes."
установил false.
- Node JS- установилaсь;
- открыл cmd Windows;
- ввёл команду `cd e:\Test\Pro01\`;
- ввёл команду `node app.js`;
- результат: сообщение об ошибке;