-bash: hexo: command not found解決辦法

運(yùn)行hexo命令時,發(fā)現(xiàn)如題這個錯誤。hexo是在之前安裝好的。
發(fā)現(xiàn)原來是沒有指定nodejs所致。
可以使用下面命令解決:

xsqMacBook-Pro:~ xsq$ hexo
-bash: hexo: command not found
xsqMacBook-Pro:~ xsq$ hexo server
-bash: hexo: command not found
xsqMacBook-Pro:~ xsq$ nvm ls
         v5.0.0
node -> stable (-> v5.0.0) (default)
stable -> 5.0 (-> v5.0.0) (default)
iojs -> N/A (default)
xsqMacBook-Pro:~ xsq$ nvm use v5.0.0
Now using node v5.0.0 (npm v3.3.6)
xsqMacBook-Pro:~ xsq$ nvm alias default v5.0.0
default -> v5.0.0
xsqMacBook-Pro:~ xsq$ hexo
Usage: hexo <command>

Commands:
  help     Get help on Hexo.
  init     Create a new Hexo folder.
  version  Display version information.

Global Options:
  --config  Specify config file instead of using _config.yml
  --cwd     Specify the CWD
  --debug   Display all verbose messages in the terminal
  --safe    Disable all plugins and scripts
  --silent  Hide output on console

For more help, you can use 'hexo help [command]' for the detailed information
or you can check the docs: http://hexo.io/docs/
xsqMacBook-Pro:~ xsq$

如果是mac用戶全局安裝hexo的時候記得使用sudo,使用管理員權(quán)限,否則會報沒有權(quán)限

sudo npm install-g hexo

如果還是不行,重啟終端。

查看是否安裝成功
node -v

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容