Quando digito o npx nodemon no terminal ele está dando esse erro:
PS C:\Users\marco\Downloads\2404-api-node-express-aula_05\2404-api-node-express-aula_05> npx nodemon
[nodemon] 2.0.15
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node index.js`
node:internal/modules/cjs/loader:959
throw err;
^
Error: Cannot find module 'C:\Users\marco\Downloads\2404-api-node-express-aula_05\2404-api-node-express-aula_05\index.js'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
[nodemon] app crashed - waiting for file changes before starting...
segue o código do index.js :
import express from "express";
import livros from "./livrosRoutes.js"
import autores from "./autoresRoutes.js"
const routes = (app) => {
app.route('/').get((req, res) => {
res.status(200).send({titulo: "Curso de node"})
})
app.use(
express.json(),
livros,
autores
)
}
export default routes;
A quem puder me ajudar obrigado!!