node.js 确保 /usr/local/bin 在 mac 上的 $PATH 中

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19202007/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 15:52:44  来源:igfitidea点击:

Making sure /usr/local/bin is in my $PATH on mac

macosnode.js

提问by Kevin Russell

I've installed node.js for Macintosh using the lastest installer for Macintosh. I now want to check that /usr/local/bin is in my $PATH, as the installer instructed. I've opened up the Terminal application and researched help on the net, but I'm lost, as to how to accomplish the above, then start the node.js process. Can anyone clear this up? Thank you for very much.

我已经使用最新的 Macintosh 安装程序为 Macintosh 安装了 node.js。我现在想按照安装程序的指示检查 /usr/local/bin 是否在我的 $PATH 中。我已经打开终端应用程序并在网上研究了帮助,但我迷失了,至于如何完成上述操作,然后启动 node.js 进程。任何人都可以解决这个问题吗?非常感谢。

回答by Greg

echo $PATHwill print your path. If you see /usr/local/binbetween some colons, then it's in your path.

echo $PATH将打印您的路径。如果您/usr/local/bin在一些冒号之间看到,那么它就在您的路径中。

回答by Edwin Ikechukwu Okonkwo

open terminal and type the command below

打开终端并输入下面的命令

echo $PATH

You should see something like this

你应该看到这样的东西

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin

the presence of /usr/local/binin the output means you are good to go

/usr/local/bin在输出中的存在意味着你很高兴