Project scenario:
in hexo + GitHub blog deployment, set up and register GitHub account and create warehouse in nodejs and git environment, and then start to set up blog
-
- Run NPM install – G hexo install hexo local environment, enter hexo to check whether the hexo command can be run
-
- (1) create a working folder for saving the local blog myblog
-
- (2) initialize the hexo blog project: hexo init
-
- (3) compile the blog system: hexo g
-
- (4) start the local server for preview: hexo s
If hexo is working properly, enter http://localhost:4000/ You can see the initial appearance of the blog
Problem Description:
after installing the local environment and using git bash in windows, the hexo init command cannot be executed, and the following error is reported: </ font>
bash: hexo: command not found
Cause analysis:
it may be that the NPM environment of node is not well configured. You can try to reinstall node and install it in the default path, or it may not be completely installed when installing with git bash
Solution:
method 1: select the folder where you downloaded the note.js, right-click to open it with git bash, and then enter the command
method 2: open the previously created folder (your blog, mine is blog), hold down shift, right-click, select PowerShell option, open the command prompt, and enter the following command:
after that, a new folder blog will be generated in your folder, which is the content to be deployed
After entering NPX hexo server, you can see that a section of address appears: http://localhost:4000 , you can preview it by typing in your browser
Note: it is recommended to use method 1, because if you use method 2 to deploy successfully, you should use NPX command when writing articles later!!!
Read More:
- HEXO D Command ERROR Deployer not found: git
- Template Render Error Solution (Hexo blog theme, GIT upload)
- Hexo Error: error: spawn failed [How to Solve]
- [MAC] How to Solve zsh Error: command not found: umi
- [Solved] Hexo FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed
- [Solved] kubectl error: sou-bash: _get_comp_words_by_ref: command not found
- How to Solve VScode 2022 error: msvcp110d.dll not found
- How to Solve Error: java.io.IOException: Resource [classpath:shiro.ini] could not be found.
- How to Solve Gradle Error: Plugin with id ‘jetty’ not found.
- How to Solve org.apache.ibatis.binding.BindingException: Invalid bound statement (not found) Error
- How to Solve golang test Error: # command-line-arguments [command-line-arguments.test]
- How to Solve Docker Run Error: standard_init_linux.go:219: exec user process caused: exec format error
- Mac Error: sh: vue-cli-service: command not found
- How to Solve J-link Error (Two Command Errors & Solution)
- Mac error: SH: Vue cli service: command not found
- [Solved] SHELL Run Error: “-BASH: ./TEST.SH: /BIN/BASH^M: BAD INTERPRETER: NO SUCH FILE OR DIRECTORY”
- How to Solve error: command ‘C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0\bin\nvcc.exe‘ failed
- How to Solve Error: could not list the contents of folder
- How to Solve Error: Resource’/Servers’ does not exist
- [Solved] Error in porting libzrtp: automake-1.14: command not found