Already installed JSON Server But show message Command Not Found

北城以北 提交于 2019-12-11 12:58:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!