node.js - 如何在 Raspberry Pi 2 上全新安装 Raspbian Jessie 时启动独立的 Screeps 服务器?

标签 node.js linux raspberry-pi screeps

在使用 Raspberry Pi 时,我完全是个菜鸟。

到目前为止我采取的步骤:

  1. 在 Raspberry Pi 2 上完成了最新稳定版 Raspbian Jessie 的全新安装。

  2. https://github.com/screeps/screeps 下载并解压缩了一个包含 Screeps 服务器文件的文件夹

  3. 尝试运行服务器文件随附的“自述文件”中给出的第一个命令

    npm install screeps
    
  4. 死了。

据我所知,在尝试安装 Screeps 服务器之前,我需要安装较新版本的 npm 和 nodejs,但我不了解如何执行这些任务中的任何一项的背景知识。

最佳答案

你有安装 npm 吗?如果没有,那么您需要先运行几个命令。 (免责声明,我将要列出的命令适用于 Ubuntu 16.04,可能适用于 Raspbian,也可能不适用于 Raspbian。一个简单的谷歌搜索将为您提供 Raspbian 等价物,但我会把这项研究留给您。)

'#' 是注释,不能在命令行中输入。

sudo apt-get update       #will update your machine
sudo apt-get upgrade      #will upgrade your machine
sudo apt-get install npm  #will install npm on your machine
sudo npm install screeps  #will use npm to install screeps
screeps init              #should be preformed in the directory you want to run screeps in and the current user has read/write/execute privileges 
screeps start             # will start your screeps server

最后一条命令可以替换为

screeps start --host x.x.x.x #'x' 表示 raspberry pi 的 ip,以便它知道它将在哪里接收请求

关于node.js - 如何在 Raspberry Pi 2 上全新安装 Raspbian Jessie 时启动独立的 Screeps 服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45080634/

相关文章:

arrays - 删除并修剪 aerospike udf 中的列表

linux - 如何更换 LED 触发器?

python - ffmpeg 不会停止编码,即使使用 -shortest 命令

javascript - Node Js、javascript、mysql,客户端看到/看不到什么?

javascript - 关于node.js回调中的 'this'

javascript - 我应该使用哪个 Node.js 路由器?

linux - Angstrom 内核 - 卡在 "Starting kernel ..."

linux - 更新 docker-compose Ubuntu 15.10

python - 将 Raspberry Pi 摄像头输入 Darknet 和 Yolo

opencv - 如何关闭Raspberry Pi上的opencv imshow()窗口?