问题描述
我在下面收到此错误。
PS C:\Users\Tan Shi Yu\Github\shopaway> npx json-server --watch data/db.json
\{^_^}/ hi!
Loading data/db.json
Oops,data/db.json doesn't seem to exist
Creating data/db.json with some default data
Error: ENOENT: no such file or directory,open 'data/db.json'
at Object.openSync (fs.js:498:3)
at Object.writeFileSync (fs.js:1524:35)
at C:\Users\Tan Shi Yu\Github\shopaway\node_modules\json-server\lib\cli\utils\load.js:44:12
at new Promise (<anonymous>)
at module.exports (C:\Users\Tan Shi Yu\Github\shopaway\node_modules\json-server\lib\cli\utils\load.js:38:10)
at start (C:\Users\Tan Shi Yu\Github\shopaway\node_modules\json-server\lib\cli\run.js:112:12)
at module.exports (C:\Users\Tan Shi Yu\Github\shopaway\node_modules\json-server\lib\cli\run.js:149:3)
at module.exports (C:\Users\Tan Shi Yu\Github\shopaway\node_modules\json-server\lib\cli\index.js:86:3)
at Object.<anonymous> (C:\Users\Tan Shi Yu\Github\shopaway\node_modules\json-server\lib\cli\bin.js:6:14)
at Module._compile (internal/modules/cjs/loader.js:1068:30) {
errno: -4058,syscall: 'open',code: 'ENOENT',path: 'data/db.json'
}
但是,我相信我的文件安装在正确的位置,如图所示。
我可以知道我是否做错了什么吗?谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)