我已经根据以下内容安装了 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/