我按照官网教程,先后安装了
接着输入
$ npm install hexo-cli -g
npm WARN deprecated [email protected]: cross-spawn no longer requires a bu ild toolchain, use it instead!
npm WARN optional dep failed, continuing [email protected]
> [email protected] install C:\program files\nodejs\node global\node_modules \hexo-cli\node_modules\hexo-log\node_modules\bunyan\node_modules\dtrace-provider
> node scripts/install.js
> [email protected] postinstall C:\program files\nodejs\node global\node_modules \hexo-cli\node_modules\hexo-util\node_modules\cross-spawn\node_modules\spawn-syn c
> node postinstall
> [email protected] postinstall C:\program files\nodejs\node global\node_modules\h exo-cli\node_modules\hexo-util
> npm run build:highlight
> [email protected] build:highlight C:\program files\nodejs\node global\node_modul es\hexo-cli\node_modules\hexo-util
> node scripts/build_highlight_alias.js > highlight_alias.json
C:\program files\nodejs\node global\hexo -> C:\program files\nodejs\node global\ node_modules\hexo-cli\bin\hexo
[email protected] C:\program files\nodejs\node global\node_modules\hexo-cli
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected]
├── [email protected] ([email protected], [email protected], ansi-styles@2 .2.1, [email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected], [email protected] )
└── [email protected] ([email protected], [email protected], [email protected], hig [email protected], [email protected])
总感觉和以前安装的提示不一样。。。
而且出现问题了
$ hexo init
bash: hexo: command not found
实际上这是我刚刚折腾半天系统变量PATH后,提示这个
原来是提示这样的

一直说在git目录下找不到node_modules
搜索了都说是系统变量的原因...各种折腾还是没解决
求指点。
为什么你的node_modules在git目录下?
参考一下我的教程: https://xuanwo.org/2015/03/26/hexo-intor/
@tiexo You can see test using [sudo] hexo init, maybe work, anything you can speak with me.
@Xuanwo
我今天又试了下,还是提示: Cannot find module 'C:\Program Files\Gitnode_modules\hexo-cli\bin\hexo'
我看了这个路径下面是没有node_modules文件夹,郁闷了
我是直接下载nodejs和git安装的啊,以前也没遇到这个问题
@felipesousa i'm windows
use winpty hexo.cmd init
这个你可以在系统盘用户目录文件下找到这个文件夹:node_modules\hexo-cli,然后你复制到git安装目录下就好了。
缺少什么,就给他补什么。


@helloqingfeng 也是遇到这个问题,用你的方法真的解决了!因为之前分别下载安装后没有出现这个问题,后来处于别的原因卸载后又重新安装,然后出现这个问题,请问您知道具体是因为什么这个文件夹的位置会发生错误吗?
@helloqingfeng 超级感谢!!有用!
Most helpful comment
这个你可以在系统盘用户目录文件下找到这个文件夹:node_modules\hexo-cli,然后你复制到git安装目录下就好了。
缺少什么,就给他补什么。
