明明安裝了gulp卻無法使用命令,網上搜索得到答案
先是嘗試:
輸入 which gulp
輸出 gulp not found
分析原因:說明gulp的確沒有全局安裝。
全局安裝gulp的正確姿勢
npm install -g gulp
如果報錯
zsh: command not found: npm
先安裝npm (執行命令: brew install npm(需要安裝homebrew))
在執行安裝命令
npm install -g gulp
在執行:
which gulp
控制檯輸出:
/usr/local/bin/gulp
完美解決。
運行截圖