Solution to the invalid node command in Ubuntu

Source: Internet
Author: User
After installing Node. js with sudoapt-getinstallnodejs in ubuntu, you will find that the node command (such as node? -Version), there will be Nosuchfileordirectory errors. The main cause of this error is that Node. js is installed in the usrbinnodejs directory by default on ubuntu, so it can only be called using nodejs by default.

After using sudo apt-get install nodejs in ubuntu to install Node. js, you will find that the node running in terminalsCommand(Such as node -- version), there will be No such file or directory errors. The main cause of this error is that Node. js is installed in the/usr/bin/nodejs directory by default on ubuntu, so it can only be called using nodejs by default.

The solution is to run the following command to create a file connection, and then the node in terminals will work normally.

sudo ln -s /usr/bin/nodejs /usr/bin/node

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.