zorgzola / zorgzola.github.io

0 stars 0 forks source link

群晖搭建Hexo博客 | zorg's Blog #9

Open zorgzola opened 4 years ago

zorgzola commented 4 years ago

https://blog.mrzorg.top/NAS/2019-04-23-synology-nas-build-hexo-blog/

利用群晖NAS和Hexo快速搭建博客

MCU-UAV commented 4 years ago

您好,我在执行 hexo init 时报错。搜索全网也没能解决,希望能得到您的解答。报错信息如下:

INFO  Cloning hexo-starter https://github.com/hexojs/hexo-starter.git
INFO  Install dependencies
internal/modules/cjs/loader.js:960
  throw err;
  ^

Error: Cannot find module '/volume1/web/blog/node_modules/ejs/postinstall.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
    at Function.Module._load (internal/modules/cjs/loader.js:840:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
    at internal/main/run_main_module.js:18:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
WARN  Failed to install dependencies. Please run 'npm install' in "/volume1/web/blog" folder.
MCU-UAV commented 4 years ago

找到原因了,执行npm install -g hexo-cli,在我这被默认安装到了:

/usr/local/lib/node_modules/hexo-cli/bin/hexo

我目前的解决办法:

cd /volume1/@appstore/Node.js_v8/usr/local/lib/node_modules

npm install hexo-cli

cd /volume1/web

hexo init blog

hexo s

最后,还需要在NAS防火墙中把端口开一下,在电脑访问“nas地址:4000”即可

zorgzola commented 4 years ago

@MCU-UAV 找到原因了。

解决就好,共同学习,看来你搞到很晚了。