繁体   English   中英

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

[英]How to start a standalone Screeps server on a clean install of Raspbian Jessie on a Raspberry Pi 2?

与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上可能有效或无效。一个简单的Google搜索将为您提供等效于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 xxxx 'x'指示树莓派的ip,以便它知道它将在哪里接收请求

您可能内存不足。 (npm需要大量内存才能运行)请尝试增加交换空间,以至少拥有2gb的可用内存。

编辑/etc/dphys-swapfile ,将CONF_SWAPSIZE更改为= 1024或1536,然后重新启动。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM