Home > Web Front-end > JS Tutorial > body text

Why Can\'t I Execute Node After Installation on Ubuntu 12.04?

Linda Hamilton
Release: 2024-11-01 12:51:42
Original
253 people have browsed it

Why Can't I Execute Node After Installation on Ubuntu 12.04?

NodeJS Installation Conundrum on Ubuntu 12.04

Despite following installation instructions, you may encounter issues executing node in the terminal, receiving the error: "-bash: /usr/sbin/node: No such file or directory." This occurs despite the presence of node in the /usr/sbin/ directory.

To resolve this issue, you'll need to create a symlink:

<code class="Bash">sudo ln -s `which nodejs` /usr/bin/node</code>
Copy after login

Alternately, if you're not using a bash-compatible shell:

<code class="Bash">sudo ln -s /usr/bin/nodejs /usr/bin/node</code>
Copy after login

Explanation from Installation Instructions

The naming conflict between node (Amateur Packet Radio Node Program) and nodejs necessitates the symlink to avoid conflicts.

Additional Solutions from Comments

Users have reported the following solutions:

  • sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
  • Remove and reinstall node and nodejs with sudo apt-get --purge remove node and sudo apt-get --purge remove nodejs, followed by sudo apt-get install nodejs.

The above is the detailed content of Why Can\'t I Execute Node After Installation on Ubuntu 12.04?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!