Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

执行hexo init时候发生:hexo:command not found #1875

Closed
eyea opened this issue Apr 8, 2016 · 12 comments
Closed

执行hexo init时候发生:hexo:command not found #1875

eyea opened this issue Apr 8, 2016 · 12 comments

Comments

@eyea
Copy link

eyea commented Apr 8, 2016

I have installed hexo nodejs GIT ,when i create a new profile,cd to this ,and "hexo init" by git bash, It's show "hexo:command not found".
2 days ,waitting for the answer online ... #285

已经安装了nodejs git hexo 但是在新建文件夹下gitbash的时候 :hexo:command not found
请教怎么解决,在线等

@eyea
Copy link
Author

eyea commented Apr 8, 2016

problem solved ,hah...

@uolcano
Copy link

uolcano commented Apr 9, 2016

@eyea 请问你的问题是怎么解决的?我用npm install hexo-cli -g安装,总是最后提示:

npm WARN optional Skipping failed optional dependency /hexo-cli/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.11

打hexo -v,cmd提示'hexo'不是内部或外部命令

@eyea
Copy link
Author

eyea commented Apr 9, 2016

@uolcano warn 提示,不会影响你后续的操作的,可以暂时忽略。
在环境变量path设置下hexo的安装目录

@uolcano
Copy link

uolcano commented Apr 9, 2016

@eyea thx,其实我这问题还有就是命令行不是别hexo命令。重装node,就ok了。估计是我装jekyll的时候,改path哪里弄删错了。

@Xuanwo
Copy link
Contributor

Xuanwo commented Apr 9, 2016

Closed for sloved.

@Xuanwo Xuanwo closed this as completed Apr 9, 2016
@leoyip
Copy link

leoyip commented Jan 16, 2017

补充一下:我的是在linux环境下遇到该问题,报错原因是安装时权限不够,然后解决方法是重新运行$ sudo npm install hexo-cli -g
参考:-bash: hexo: command not found解决办法

@huanjulu
Copy link

huanjulu commented Feb 9, 2017

@leoyip yes , its works ! thank you so much,

@sophieChenyx
Copy link

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\hexo-cli\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
这个问题怎么解决啊 也找不到我的hexo
是不是需要重新安装node 的版本

@SomeoneSometimes
Copy link

重新安装一下nodejs,或者在删除应用的面板中选择修复一下nodejs应该就可以了

@Fangyh09
Copy link

Fangyh09 commented Feb 25, 2018

I solved by

ln -s /usr/local/bin/hexo /usr/bin/hexo
ln -s /usr/local/bin/node /usr/bin/node

@KingfaLuis
Copy link

bash: hexo: command not found
我也是遇到了这个问题尝试了
hexo s
hexo g
hexo d
尝试以上的命令都不行。
我猜想,是不是我在清理系统垃圾的时候删除了什么配置的东西?我还没有检查。

@litingjun2015
Copy link

我之前也是遇到:

$ npm install hexo-cli -g
C:\Users\John\AppData\Roaming\npm\hexo -> C:\Users\John\AppData\Roaming\npm\node                                                                                                                                                 _modules\hexo-cli\bin\hexo
npm WARN rollback Rolling back iconv-lite@0.4.24 failed (this is probably harmle                                                                                                                                                 ss): EPERM: operation not permitted, scandir 'C:\Users\John\AppData\Roaming\npm\                                                                                                                                                 node_modules\hexo-cli\node_modules\fsevents\node_modules'
npm WARN rollback Rolling back readable-stream@2.3.6 failed (this is probably ha                                                                                                                                                 rmless): EPERM: operation not permitted, scandir 'C:\Users\John\AppData\Roaming\                                                                                                                                                 npm\node_modules\hexo-cli\node_modules\fsevents'
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\hex                                                                                                                                                 o-cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@                                                                                                                                                 1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}                                                                                                                                                 )

+ hexo-cli@1.1.0
added 225 packages from 433 contributors in 64.606s

John@SC-201703161801 MINGW64 ~
$

John@SC-201703161801 MINGW64 ~
$ pwd
/c/Users/John

John@SC-201703161801 MINGW64 ~
$ hexo init blog
bash: hexo: command not found

看到 @leoyip 的回复用管理员身份打开Git Bash成功了:

Administrator@SC-201703161801 MINGW64 /c/Users/John
$ npm install hexo-cli -g
C:\Users\Administrator\AppData\Roaming\npm\hexo -> C:\Users\Administrator\AppData\Roaming\npm\node_modules\hexo-cli\bin\hexo
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\hexo-cli\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

+ hexo-cli@1.1.0
added 225 packages from 433 contributors in 54.886s

Administrator@SC-201703161801 MINGW64 /c/Users/John
$ hexo init blog
INFO  Cloning hexo-starter to C:\Users\John\blog
Cloning into 'C:\Users\John\blog'...
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 71 (delta 0), reused 0 (delta 0), pack-reused 68
Unpacking objects: 100% (71/71), done.
Submodule 'themes/landscape' (https://github.com/hexojs/hexo-theme-landscape.git) registered for path 'themes/landscape'
Cloning into 'C:/Users/John/blog/themes/landscape'...
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 867 (delta 0), reused 0 (delta 0), pack-reused 866
Receiving objects: 100% (867/867), 2.55 MiB | 79.00 KiB/s, done.
Resolving deltas: 100% (459/459), done.
Submodule path 'themes/landscape': checked out '73a23c51f8487cfcd7c6deec96ccc7543960d350'
INFO  Install dependencies
npm WARN deprecated titlecase@1.1.2: no longer maintained
npm WARN rollback Rolling back iconv-lite@0.4.24 failed (this is probably harmless): EPERM: operation not permitted, lstat 'C:\Users\John\blog\node_modules\fsevents'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.7 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.7: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

added 421 packages from 503 contributors and audited 4697 packages in 70.287s
found 2 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
INFO  Start blogging with Hexo!

感谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants