Error: Cannot find module './db.json'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:286:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object.
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (/user/XXX/node_modules/hexo/lib/hexo/index.js:213:21)
at /user/XXX/node_modules/hexo-server/index.js:24:50
at /user/XXX/node_modules/hexo/lib/hexo/index.js:229:12
at tryCatcher (/user/XXX/node_modules/hexo/node_modules/hexo-fs/node_modules/bluebird/js/release/util.js:11:23)
at Promise._settlePromiseFromHandler (/user/XXX/node_modules/hexo/node_modules/hexo-fs/node_modules/bluebird/js/release/promise.js:489:31)
at Promise._settlePromise (/user/XXX/node_modules/hexo/node_modules/hexo-fs/node_modules/bluebird/js/release/promise.js:546:18)
at Promise._settlePromise0 (/user/XXX/node_modules/hexo/node_modules/hexo-fs/node_modules/bluebird/js/release/promise.js:591:10)
at Promise._settlePromises (/user/XXX/node_modules/hexo/node_modules/hexo-fs/node_modules/bluebird/js/release/promise.js:674:18)
at Promise._fulfill (/user/XXX/node_modules/hexo/node_modules/hexo-fs/node_modules/bluebird/js/release/promise.js:615:18)
at Promise._resolveCallback (/user/XXX/node_modules/hexo/node_modules/hexo-fs/node_modules/bluebird/js/release/promise.js:416:57)
at Promise._settlePromiseFromHandler (/user/XXX/node_modules/hexo/node_modules/hexo-fs/node_modules/bluebird/js/release/promise.js:502:17)
at Promise._settlePromise (/user/XXX/node_modules/hexo/node_modules/hexo-fs/node_modules/bluebird/js/release/promise.js:546:18)
at Promise._settlePromise0 (/user/XXX/node_modules/hexo/node_modules/hexo-fs/node_modules/bluebird/js/release/promise.js:591:10)
at Promise._settlePromises (/user/XXX/node_modules/hexo/node_modules/hexo-fs/node_modules/bluebird/js/release/promise.js:674:18)
INFO Deleted database.
INFO Deleted public folder.
报db.json的错误是什么原因。但是命令还正常执行了。hexo g 也是相同的错误,但是同样也构建出public 了
XXXX$ hexo -v
ERROR Plugin load failed: hexo-server
Error: Cannot find module './db.json'
.....
hexo: 3.1.1
os: Darwin 14.3.0 darwin x64
http_parser: 2.5.0
node: 4.1.2
v8: 4.5.103.35
uv: 1.7.5
zlib: 1.2.8
ares: 1.10.1-DEV
modules: 46
openssl: 1.0.2d
我把node-modules 删除之后重装之后ok了。不知道为什么,之前这个问题也出现过
This happened because somehow db.json file is missing in mime-db modules... You can create a db.json file or install mime-db module in a different location and copy db.json from there.
Most helpful comment
This happened because somehow db.json file is missing in mime-db modules... You can create a db.json file or install mime-db module in a different location and copy db.json from there.