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