当我输入此命令时
sudo json-server db.json
我收到了这个错误:
/usr/local/lib/node_modules/json-server/src/cli/utils/load.js:31
data = low(source, { storage: fileAsync }).state()
^
TypeError: low(...).state is not a function
at module.exports (/usr/local/lib/node_modules/json-server/src/cli/utils/load.js:31:48)
at start (/usr/local/lib/node_modules/json-server/src/cli/run.js:99:5)
at module.exports (/usr/local/lib/node_modules/json-server/src/cli/run.js:126:3)
at module.exports (/usr/local/lib/node_modules/json-server/src/cli/index.js:86:3)
at Object.<anonymous> (/usr/local/lib/node_modules/json-server/bin/index.js:2:22)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
有人可以帮我吗?
答案 0 :(得分:0)
我遇到了同样的问题,但通过卸载安装了--save-dev的json-server模块修复了问题。尝试将模块作为全局模块阅读。
答案 1 :(得分:0)