将Node.js设置为$ PATH [英] Set Node.js to $PATH

查看:99
本文介绍了将Node.js设置为$ PATH的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究RoR,并将此虚拟机设置为部署 RoR,并且卡在Node.js安装中。

I am studying RoR and I am setting this virtual machine to "deploy" RoR and I got stuck in the Node.js installation.

我正在使用Ubuntu 12.04。我遵循了本指南的这一步骤:

I am using Ubuntu 12.04 and I followed this step of this guide:

http:// railsapps.github.com/installing-rails.html


自Rails 3.1以来,需要JavaScript运行时来进行开发Ubuntu Linux(Mac OS X或Windows不需要)。对于在Linux Ubuntu上进行
开发,最好安装Node.js
服务器端JavaScript环境:

Since Rails 3.1, a JavaScript runtime has been needed for development on Ubuntu Linux (it is not needed for Mac OS X or Windows). For development on Linux Ubuntu, it is best to install the Node.js server-side JavaScript environment:

$ sudo apt-get install nodejs

并将其设置在$ PATH中。

and set it in your $PATH.

设置为我的$ PATH是什么意思?

What does it mean, "set to my $PATH"?

我上次在Google上一直在搜索它几个小时,所有解决方案都不一样,针对不同的问题,对此我没有简单的答案。

I've been searching for it on google in the last couple of hours and all solutions are different, for different problems and I get no simple answer for that. Can you give a little light here?

谢谢!

推荐答案

您不必担心, apt-get install 命令将为您完成此操作。
它将nodejs进程的路径(通常 / usr / bin / node )添加到全局$ PATH变量中。这样可以确保当您在终端中键入 node 时,它将启动nodejs进程。

You don't have to worry about that, the apt-get install command will do that for you. It adds the path to the nodejs process (usually /usr/bin/node) to the global $PATH variable. This ensures that when you type node in your terminal it will start the nodejs process.

如果由于某种奇怪的原因而无法启动它,则必须将节点安装的路径手动添加到$ PATH中。您可以通过编辑〜/ .bashrc 文件并添加:

If for some weird reason you cannot start it, you'll have to manually add the path to your node installation to the $PATH. You can do this by editing your ~/.bashrc file and adding:

PATH=/usr/bin/node:$PATH

这篇关于将Node.js设置为$ PATH的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆