也不知道怎么回事办公室的电脑突然重启了,可能是更新吧,但是更新完了回来发现hexo generate 和 deploy 并不能使用了
最开始报的错是 Node 不是内部或外部命令
,一看是 node.js 的环境变量没有配置,很奇怪,之前明明是OK的,然后我就在环境变量里面配置了一下node,步骤如下:
- 右键
我的电脑-属性-高级系统设置
- 找到下面有个
环境变量
的选择框,点进去 - 此时出来的对话框中有上下两个部分,上面的部分属于
用户变量
,找到里面有一行是path
,点击编辑
- 新建一个变量,把node.js所在的路径拷进去就行了,我的是
D:\Program Files\nodejs
然后 hexo generate
就可以了,deploy的时候发现出现以下问题:1
2
3
4
5
6FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs/troubleshooting.html
Error: spawn git ENOENT
at notFoundError (C:\Users\XXX\hexo\node_modules\cross-spawn\lib\enoent.js:11:11)
at verifyENOENT (C:\Users\XXX\hexo\node_modules\cross-spawn\lib\enoent.js:46:16)
at ChildProcess.cp.emit (C:\Users\XXX\hexo\node_modules\cross-spawn\lib\enoent.js:33:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
那个XXX是hexo所在文件的路径,这里就不放出来了。
解决这个的问题最直接的办法就是直接在hexo的当前文件夹下,运行 git bash
然后在bash 处运行 hexo deploy
…