Skip to content
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

Error on start server #818

Closed
shic opened this issue Jul 3, 2018 · 5 comments
Closed

Error on start server #818

shic opened this issue Jul 3, 2018 · 5 comments

Comments

@shic
Copy link

shic commented Jul 3, 2018

First run json-server –watch MY_URL/db.json success.

Restart computer and run json-server –watch MY_URL/db.json got:

  \{^_^}/ hi!

  Loading –watch
/usr/local/lib/node_modules/json-server/lib/cli/utils/load.js:39
    throw new Error(`Unsupported source ${source}`);
    ^

Error: Unsupported source –watch
    at module.exports (/usr/local/lib/node_modules/json-server/lib/cli/utils/load.js:39:11)
    at start (/usr/local/lib/node_modules/json-server/lib/cli/run.js:125:5)
    at module.exports (/usr/local/lib/node_modules/json-server/lib/cli/run.js:162:3)
    at module.exports (/usr/local/lib/node_modules/json-server/lib/cli/index.js:81:3)
    at Object.<anonymous> (/usr/local/lib/node_modules/json-server/lib/cli/bin.js:3:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

db.json is a json with right format.

Do not know why I have this error

@typicode
Copy link
Owner

Hi @shic I'm not sure -watch is recognized as an option, I would suggest trying with --watch

@teuk1
Copy link

teuk1 commented Nov 21, 2019

@shic After the computer restart -watch seems to be useless. This following code should work
json-server MY_URL/db.json

@typicode i used -watch and it worked 0_o the first time...

@humza-dev
Copy link

@shic After the computer restart -watch seems to be useless. This following code should work json-server MY_URL/db.json

@typicode i used -watch and it worked 0_o the first time...

AFTER doing --watch it's not working either

@mgabrielag
Copy link

The following command worked for me: json-server --watch db.json

@EdozieJerry
Copy link

am having this same issue

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

6 participants