Skip to content

SyntaxError: Unexpected token '', "{ "pos"... is not valid JSON #1631

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ligteltelecom opened this issue Feb 14, 2025 · 1 comment
Open

Comments

@ligteltelecom
Copy link

Hi can anyone help me with this issue ?

D:\projetos_angular\frontend>npx json-server db.json
<anonymous_script>:1
{
^

SyntaxError: Unexpected token '', "{
  "pos"... is not valid JSON
    at JSONFile.parse (<anonymous>)
    at JSONFile.read (file:///D:/projetos_angular/frontend/node_modules/lowdb/lib/adapters/node/DataFile.js:17:31)
    at async Observer.read (file:///D:/projetos_angular/frontend/node_modules/json-server/lib/observer.js:21:22)
    at async Low.read (file:///D:/projetos_angular/frontend/node_modules/lowdb/lib/core/Low.js:16:22)
    at async file:///D:/projetos_angular/frontend/node_modules/json-server/lib/bin.js:114:1

Node.js v22.14.0

D:\projetos_angular\frontend>

db.json below:

{ "posts": [ { "id": "1", "title": "a title" }, { "id": "2", "title": "another title" } ], "comments": [ { "id": "1", "text": "a comment about post 1", "postId": "1" }, { "id": "2", "text": "another comment about post 1", "postId": "1" } ], "profile": { "name": "typicode" } }

@ligteltelecom
Copy link
Author

Using json-server version "0.17.4" working fine
npm i [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant