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.