Json-server: Error on start server

Created on 3 Jul 2018  路  2Comments  路  Source: typicode/json-server

First run json-server 鈥搘atch MY_URL/db.json success.

Restart computer and run json-server 鈥搘atch MY_URL/db.json got:

  \{^_^}/ hi!

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

Error: Unsupported source 鈥搘atch
    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

Most helpful comment

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

All 2 comments

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

@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...

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sboudouk picture sboudouk  路  3Comments

AdamCook44 picture AdamCook44  路  3Comments

goldmont picture goldmont  路  3Comments

ashleydavis picture ashleydavis  路  3Comments

Isanderthul picture Isanderthul  路  3Comments