INFO Validating config INFO Start processing INFO Hexo is running at http://localhost:4000 . Press Ctrl+C to stop. [Browsersync] Access URLs: ---------------------------------- UI: http://localhost:3001 ---------------------------------- UI External: http://localhost:3001 ----------------------------------
这里就发现Browsersync生效了。
然后就是生成框架了。还是直接用Yeoman来自动创建一下,方便。
1 2
npm install yo -g npm install generator-hexo-theme -g
npm ERR! code ENOTFOUND npm ERR! errno ENOTFOUND npm ERR! network request to https://registry.npm.taobao.org/hexo failed, reason: getaddrinfo ENOTFOUND registry.npm.taobao.org npm ERR! network This is a problem related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings. npm ERR! network npm ERR! network If you are behind a proxy, please make sure that the npm ERR! network 'proxy' config is set properly. See: 'npm help config'
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\o_oyao\AppData\Roaming\npm-cache\_logs\2020-12-19T04_21_26_487Z-debug.log
看起来貌似是我之前配置的淘宝源的问题。好吧,我不知道怎么解决,来试试用yarn装吧。
然而yarn给我卡在了这一步
1 2 3 4 5 6
[4/4] Building fresh packages... [6/7] ⠐ hexo-math [7/7] ⠐ yo [-/7] ⠈ waiting... [-/7] ⠈ waiting... [-/7] ⠈ waiting...
仔细阅读报错(虽然完全读不懂),但是我发现里面有一句话:with --force to overwrite files recklessly。然后结合前面的报错,说什么什么已存在(明明不存在啊。。。),然后就觉得,既然它认为存在,那就强制overwrite一下呗。
1
npm install hexo-cli -g --force
然后,果然成功了!!!!
1 2 3 4
npm WARN using --force I sure hope you know what you are doing. C:\Users\o_oyao\AppData\Roaming\npm\hexo -> C:\Users\o_oyao\AppData\Roaming\npm\node_modules\hexo-cli\bin\hexo + hexo-cli@4.2.0 added 66 packages from 338 contributors in 7.271s