Configuration of Node environment variables and issues in Linux, node Environment Variables

Source: Internet
Author: User

Configuration of Node environment variables and issues in Linux, node Environment Variables

This is a pitfall that was previously encountered when configuring Node environment variables in Linux. Today, some friends have asked this question. Therefore, it is recorded not only for reference, but also for future reference.

Before this, I believe that have been installed, not installed can view another blog article --------- http://www.cnblogs.com/Halifa/p/5772263.html

You can configure the Node environment variables to take effect permanently or permanently.

 

Enter the topic:

Modify the/etc/profile file and add the following content at the end

Export NODE_HOME =/usr/local/node // Node PATH export PATH = $ NODE_HOME/bin: $ PATH

After the modification, you must log on again to make the modification take effect. You can also execute the command source/etc/profile or./etc/profile to make the modification take effect (note. There is a space in/etc/profile)

View PATH

View Single environment variable echo $ PATH view all environment variables env

Even if the configuration is complete, when a non-root user is used, use sudo node to view the node version. The following error is reported: command not found. The solution is as follows:

Use vim to enter the/etc/sudoers file, add the required path to "secure_path", and save the modification. The problem is solved.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.