Skip to content

Instantly share code, notes, and snippets.

@Alloyed
Last active April 28, 2021 03:49
Show Gist options
  • Save Alloyed/8d2a714214830459306ee094ffd14e98 to your computer and use it in GitHub Desktop.
Save Alloyed/8d2a714214830459306ee094ffd14e98 to your computer and use it in GitHub Desktop.
how to install luarocks on windows in 2020 :(
  1. get python (lol). make sure you check the box that says "add python to PATH", this will be important later

https://www.python.org/

  1. get a visual studio compiler. make sure to select either desktop development with C++ or, game dev with C++, or both~

https://visualstudio.microsoft.com/downloads/

  1. open a native tools command prompt: select x64 native tools command prompt for VS2019 from the start menu

  2. install and run hererocks

pip install git+https://github.com/luarocks/hererocks
hererocks --luajit 2.1.0-beta3 -r latest <the new folder you want to install lua at>
  1. go to start menu and type in "Edit environment variables for your account". from this screen, edit your Path variable to include
<lua folder>/bin
  1. close your native tools command prompt and reopen it

  2. try the lua and luarocks commands to see if they work.

  3. as of 10/31/2020, the luarocks install might be broken! see luarocks/luarocks#1232 if so, open up <lua folder>\bin\luarocks.bat, you should see something like

@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
 >NUL
SET "LUA_PATH=E:\lua\luarocks\lua\?.lua;E:\lua\luarocks\lua\?\init.lua;%LUA_PATH%"

that >NUL is not supposed to be there, let's just manually remove it:

@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION ENABLEEXTENSIONS
SET "LUA_PATH=E:\lua\luarocks\lua\?.lua;E:\lua\luarocks\lua\?\init.lua;%LUA_PATH%"

and try again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment