Screeps Server on windows
-
EDIT:
1. Download and install npm
https://www.npmjs.com/package/npm
**When installing there will be a option to add to env var make sure its selected
2. Restart server
3. From elevated powershell or cmd
npm install --global --production windows-build-tools
4. Restart server
5. From elevated powershell or cmd:
npm install -g screeps
cd \
mkdir .\yourDirHere
i.e. mkdir .\server
cd .\yourDirHere
i.e. cd .\server
6. Screeps init
**It will then ask for your web api, copy and paste into power shell or cmd
7. Screeps start
And voila you're up and running.EDIT EDIT:
You might have to create inbound/outbound firewall rules for node js
If you want to start your server up again just go to powershell or cmd, cd to your server dir and run: screeps start
-
I tried doing this on windows 2012 R2 and I keep getting Error on initializing Steam API. I have added my key to the .screepssrc file like this
steam_api_key = XXXXXXXXXXXXX
Any ideas?
-
EDIT: Please refer to new instructions.
-
Thank you for posting this!
Thanks so much, it was really helpful.
@lolzor said in Screeps Server on windows:
- From elevated powershell or cmd npm install --global --production windows-build-tools [...]
- From elevated powershell or cmd: npm install -g screeps cd \ mkdir .\yourDirHere i.e. mkdir .\server
I didn't need to restart server (your step #4), but I did need to do some other commands, specifically install node-gyp globally using npm install, changing the Windows Execution Policy to allow node-gyp to run, and then continuing with step 5.
How to install screeps-server-mockup on Windows 10
These are my steps from the beginning, using an Administrative Powershell (Windows+X, Windows PowerShell (Admin):
npm install --global --production windows-build-tools npm install -g node-gyp Set-ExecutionPolicy Unrestricted npm install -g screeps
I selected [A] for Yes to All about the Windows Execution Policy change, which was necessary to run node-gyp in the Administrative PowerShell.
My environment using nvm (Node Version Manager) is Windows 10 and Node v10.20.1 x64 bit.
That let me run the following inside the screeps-typescript-starter project:
npm install npm install screeps-server-mockup npm run test
The integration tests that depend on the screeps server succeed!
To recap, here are my global npm modules: (Windows 10 running Node 10.20.1, 64-bit via nvm)
PS C:\Windows\system32> npm list -g --depth=0 C:\Program Files\nodejs +-- node-gyp@6.1.0 +-- npm@6.14.4 +-- screeps@4.1.6 `-- windows-build-tools@5.2.2
And my nvm list for confirmation:
C:\dev\screeps-typescript-starter λ nvm list 14.1.0 12.16.1 * 10.20.1 (Currently using 64-bit executable)
I'm not 100% sure how I would get the windows-build-tools global on yarn, so I did switch back to npm from my first attempts using yarn. I guess it doesn't make much difference, though.
(For what it's worth, yarn test is the same as npm test, since yarn test calls what's in the package.json file, which is npm run test-unit && npm run-test-integration... The only difference appears to be that yarn test tells me the whole process took "Done in 17.41s" but I get no such message with npm.)
PS The code highlighter here on the Screeps forum is amazing!!! What is it???