記錄一些 Mac上遇到一些問題:
電腦更新后,不知道怎么環(huán)境出現(xiàn)了一些問題, 想安裝serve,自己打包后,啟動服務(wù),但是npm i serve -g? ?,就是報 command not found
source ~/.bash_profile? ?保存環(huán)境變量后沒有生效
原因:zsh和bash有別, zsh模式不執(zhí)行上述腳本,bash模式才執(zhí)行
zsh、bash 模式互相切換
切換bash ??chsh -s /bin/bash
切換zsh ? ??chsh -s /bin/zsh
1、切換到bash?
2、vim? ~/.bash_profile
? ? ? ? ?:wq
3、source?~/.bash_profile
1、進(jìn)入主目錄?cd ~
2、顯示隱藏文件,找到.bash_profile文件夾 ls -a(如果沒有可以只直接創(chuàng)建)
3、編輯文件??sudo vim .bash_profile
4、按i進(jìn)入編輯模式,加入source ~/.bash_profile后,esc文章來源:http://www.zghlxwxcb.cn/news/detail-799547.html
5、:wq保存退出文章來源地址http://www.zghlxwxcb.cn/news/detail-799547.html
到了這里,關(guān)于Mac command not found的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!