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???