在 Terminal 中先切换到 /usr/bin/ 目录,输入:cd /usr/bin/
再执行 open ~/.bash_profile,
在 .bash_profile 中添加以下的内容:
export PATH="$PATH:/Users/xxx/phantomjs-2.1.1-macosx/bin"
然后在终端输入:echo $PATH,路径清单将显示如下内容:
sbin:/Users/xxx/phantomjs-2.1.1-macosx/bin”
至此问题解决!
本文介绍如何在MacOS系统中正确配置PhantomJS环境变量,通过修改.bash_profile文件来确保PhantomJS能够被系统路径正确识别。
在 Terminal 中先切换到 /usr/bin/ 目录,输入:cd /usr/bin/
再执行 open ~/.bash_profile,
在 .bash_profile 中添加以下的内容:
export PATH="$PATH:/Users/xxx/phantomjs-2.1.1-macosx/bin"
然后在终端输入:echo $PATH,路径清单将显示如下内容:
sbin:/Users/xxx/phantomjs-2.1.1-macosx/bin”
至此问题解决!
被折叠的 条评论
为什么被折叠?