linux - Node.js 安装错误

标签 linux node.js installation

我已经根据以下内容安装了 Node.js、NVM 和 NPM:https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-an-ubuntu-14-04-server

我的工作目录是这样的:

Working_Files\WebRTC 包含以下文件:

  • package.json
  • server.js

Working_Files\WebRTC\views 其中包含一个索引文件:

index.ejs

在 Working_Files\WebRTC 中,为了运行服务器,使用:

  node server.js

每次我都必须重复安装中解释的过程,否则我会收到错误:

 node server.js 
 The program 'node' can be found in the following packages:
  * node
  * nodejs-legacy
  Try: sudo apt-get install <selected package>

请问错误在哪里?

谢谢

最佳答案

试试这个:sudo ln -s "$(which nodejs)"/usr/bin/node

然后再次运行 node server.js

关于linux - Node.js 安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33675450/

相关文章:

installation - InstallShield 配置文件中的设置

javascript - ExpressJS函数无法返回

javascript - Electron 对话框不会阻止与页面的交互

linux - 是否有任何 UNIX/Linux 命令可以检查 2 行是否连续

sql - Linux Sqliteman 安装后所有按钮和选项卡都显示为禁用,需要配置帮助吗?

node.js - Couchdb View 按行返回行

.net - 有人知道 Inno Setup 的可靠 .NET Framework 2.0 安装程序脚本吗?

xml - 使用 Wix 安装程序创建注册表项

python - 将命令插入 Bash Shell

java - 如何在众多项目中指向我的项目中的一个 logback.xml 文件