问题
I already installed in other computers by npm the json-server. But on my MacBook Pro the command was run with successful and when I will execute the command json-server db.json is showed the message:
Errors Screenshot
My versions:
node -v and npm -v
回答1:
I did fix this following these steps:
https://gist.github.com/rcugut/c7abd2a425bb65da3c61d8341cd4b02d
回答2:
I too got this issue. while working on a frontend project(vue).
I don't know why it happens but I found a way around / solution.
go to your pakage.json file. go to "scripts" and add
"scripts": {
"fakeDB":"json-server --watch db.json"
},
you can change "fakeDB" to what ever you want and "json-server --watch " is used to run your json db file in my case its db.json
来源:https://stackoverflow.com/questions/50827653/already-installed-json-server-but-show-message-command-not-found