【问题标题】:Unable to run json server无法运行 json 服务器
【发布时间】:2020-12-09 20:39:30
【问题描述】:
cd React/json-server
$ npm i json-server

+ json-server@0.16.1
added 229 packages from 124 contributors and audited 229 packages in 19.279s

$ json-server --watch db.json
bash: json-server: command not found

【问题讨论】:

    标签: json json-server


    【解决方案1】:

    你叫它的方式,你需要把它安装成一个全局命令:

    sudo npm i -g json-server
    

    然后尝试运行它。

    【讨论】:

    • not working 是什么意思,确切的错误是什么?
    • 当我在答案中执行命令时,我就可以执行 json-server。它安装在:/usr/local/bin/json-server -> ../lib/node_modules/json-server/lib/cli/bin.js。所以我无法复制你的错误..
    猜你喜欢
    • 1970-01-01
    • 2019-09-30
    • 2014-07-31
    • 2012-08-21
    • 2014-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多