首页 > 解决方案 > 找不到命令“nodejs”,但可以安装:sudo apt install nodejs in ububtu

问题描述

已安装 node.js 但显示

nodejs找不到命令,但可以安装:

  sudo apt install nodejs

然后试了,sudo apt install nodejs

并显示

Reading package lists... Done
Building dependency tree       
Reading state information... Done
nodejs is already the newest version (14.13.1-deb-1nodesource1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

但是当我尝试检查 node.js 版本时,$ nodejs -v 它显示,nodejs找不到命令,但可以安装:

sudo apt install nodejs

请帮我解决这个错误并正确查看 node.js 版本

标签: node.jsubuntu

解决方案


The nodejs executable is called node, please run node --version to see if your installation works.


推荐阅读