在使用 Raspberry Pi 时,我完全是个菜鸟。
到目前为止我采取的步骤:
在 Raspberry Pi 2 上完成了最新稳定版 Raspbian Jessie 的全新安装。
从 https://github.com/screeps/screeps 下载并解压缩了一个包含 Screeps 服务器文件的文件夹
尝试运行服务器文件随附的“自述文件”中给出的第一个命令
npm install screeps
死了。
据我所知,在尝试安装 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/