0
respostas

Problemas em preparando ambiente

Após a execução dos passos em preparando ambiente, no terminal do diretório api-alurabooks, depois de ter utilizado o comando cd api-alurabooks, ao usar o comando npm run start-auth, me é apresentado o seguinte conteúdo:

PS C:\Users\guilh\OneDrive\Área de Trabalho\Projeto-Alura-Books(HTTP)\api-alurabooks> npm run start-auth

> json-server-api@1.0.0 start-auth
> node server.js

node:internal/modules/cjs/loader:1247
  throw err;
  ^

Error: Cannot find module 'json-server'
Require stack:
- C:\Users\guilh\OneDrive\Área de Trabalho\Projeto-Alura-Books(HTTP)\api-alurabooks\server.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1244:15)
    at Function._load (node:internal/modules/cjs/loader:1070:27)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1335:12)
    at require (node:internal/modules/helpers:136:16)
    at Object.<anonymous> (C:\Users\guilh\OneDrive\Área de Trabalho\Projeto-Alura-Books(HTTP)\api-alurabooks\server.js:3:20)
    at Module._compile (node:internal/modules/cjs/loader:1562:14)
    at Object..js (node:internal/modules/cjs/loader:1699:10)
    at Module.load (node:internal/modules/cjs/loader:1313:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\guilh\\OneDrive\\Área de Trabalho\\Projeto-Alura-Books(HTTP)\\api-alurabooks\\server.js'
  ]
}

Node.js v22.13.1

Ademais, ao tentar acessar tanto o http://localhost:8000/, quanto o http://localhost:3000/, sou informado que a conexão com localhost foi recusada.

Por fim, no diretório curso-react-alurabooks, ao tentar realizar o comando npm start no terminal, sou apresentado ao seguinte conteúdo:

> json-server-api@1.0.0 start
> json-server --watch ./database.json

--watch/-w can be omitted, JSON Server 1+ watches for file changes by default
JSON Server started on PORT :3000
Press CTRL-C to stop
Watching ./database.json...

♡⸜(˶˃ ᵕ ˂˶)⸝♡

Index:
http://localhost:3000/

Static files:
Serving ./public directory if it exists

Endpoints:
http://localhost:3000/pedidos
http://localhost:3000/livros
http://localhost:3000/autores
http://localhost:3000/categorias

E ao acessar o link http://localhost:3000/, sou direcionado para uma pagina irregular do alura-books,