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
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...
Most helpful comment
Hi @shic I'm not sure
-watchis recognized as an option, I would suggest trying with--watch