Olá a todos! Percebi um erro diferente ao tentar conectar com o dado mockado. Ao tentar executar o comando:
npx json-server --watch db.json --port 5000
O seguinte erro aparecia:
npx json-server --watch db.json --port 5000
fs.js:47
} = primordials;
^
ReferenceError: primordials is not defined
at fs.js:47:5
at req_ (C:\Users\Pedro\Documents\Projects\React-Web\gatitoblog\gatitoblog\node_modules\natives\index.js:143:24)
at Object.req [as require] (C:\Users\Pedro\Documents\Projects\React-Web\gatitoblog\gatitoblog\node_modules\natives\index.js:55:10)
at Object.<anonymous> (C:\Users\Pedro\Documents\Projects\React-Web\gatitoblog\gatitoblog\node_modules\configstore\node_modules\graceful-fs\fs.js:1:37)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
Possível solução: Tente utilizar o código
npm audit fix --force
Após finalizar o audit, tente executar o código npx json-server --watch db.json --port 5000 novamente!
õ/