'nodejs program does not find server.js file when run server.js file and when I ran it directly, it make me a spelling mistake?
I am making a Nodejs file following this tutorial
https://www.bezkoder.com/react-node-express-mysql/
and here is my code
https://github.com/anhquanjp/problemreact1
My problem is, when I ran the code node server.js at step Run the Node.js Express Server , it said to me that I had this error :
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '/Users/anhbui/Documents/React + Node.js + Express + MySQL
example/nodejs-express-sequelize-mysql/server.js'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
When I got in the folder roots to run the server.js, it said to me that I have this error :
SyntaxError: Unexpected token ')'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1027:15)
at Module._compile (node:internal/modules/cjs/loader:1063:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
But, I think that my server.js is not have a spelling mistake like this. Maybe because some another mistakes ?
Could you please see my code and give me some ideas ? Thank you very much for your time.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
