建立文章node
$ hexo new "My New Post"
启动本地 Servergit
// 默认监听4000端口 $ hexo server //or $ hexo s
命令运行成功后可经过 http://localhost:4000/ 访问页面。github
使用 -p
后缀可指定监听端口号,默认监听4000端口。npm
// 监听3000端口 $ hexo s -p 3000
生成静态文件hexo
$ hexo generate // or $ hexo g
部署ide
$ hexo deploy // or $ hexo d
在部署以前,要先执行生成静态文件,不然部署时没法检测到文件更新。ui
运行hexo命令总提示 Module version mismatch.
异常code
[Error: Module version mismatch. Expected 47, got 44.] { [Error: Cannot find module './build/default/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' } { [Error: Cannot find module './build/Debug/DTraceProviderBindings'] code: 'MODULE_NOT_FOUND' }
It seems there was a mismatch between one of:server
The hexo in node_modules/.bin部署
The hexo in /usr/local/bin/hexo
The globally installed hexo which may well have been the one from 2.
My solution was:
npm uninstall -g hexo-cli rm /usr/local/bin/hexo rm -rf node_modules npm install npm install -g hexo-cli
Detail see Module version mismatch #1742