Configuring node environment variables and issues in Linux

Source: Internet
Author: User

This is the previous time under the Linux configuration node environment variables stepped on the pit, and today there are small partners to question the problem, so the record, not only for the new children's shoes for some reference, but also to facilitate future inspection

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

There are several ways to configure the node environment variable to be permanent and effective at that time, only the permanent effect is explained here

Enter the topic:

Modify the/etc/profile file to add the following at the end

Export Node_home=/usr/local/node  

After the modification is completed, you need to re-login to take effect, or you can execute command source/etc/profile or. /etc/profile come into effect (note.) With a space in/etc/profile)

View Path

View a single environment variable echo $PATH See all environment variables env

This is done, but when using a non-root user, use sudo node to view the version of node, and find the error: Command not found, the workaround is as follows:

Use Vim to enter the/etc/sudoers file, add your desired path to "Secure_path", save the changes, the problem is solved

Configuring node environment variables and issues in Linux

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.