# LuaRocks install on windows

**URL:** <https://forum.defold.com/t/luarocks-install-on-windows/70519>\
**Category:** The Defoldmine\
**Created:** [March 11, 2022, 9:25am UTC](https://forum.defold.com/t/luarocks-install-on-windows/70519 "2022-03-11T09:25:51Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [March 11, 2022, 9:25am UTC](https://forum.defold.com/t/luarocks-install-on-windows/70519/1 "2022-03-11T09:25:51Z")

</div>

LuaRocks is package manager for lua.  
**Defold not need it**. But you can use local Lua and LuaRocks to solve some tasks.  
For example i use it for map parsing from tiled.

Installing LuaRocks in window pc is a HELL.  
I try different ways of installing it. And find guide that worked for me.

Few days ago i try to install it on new pc and find that guide is not available.  
So i make a copy of that guide with some small changes.

> **[GitHub - d954mas/windows-lua-luarocks-install-guide: Guide how to install lua and luarocks in window pc](https://github.com/d954mas/windows-lua-luarocks-install-guide)**
>
> Guide how to install lua and luarocks in window pc

Maybe someone find it usefull.

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 11, 2022, 9:30am UTC](https://forum.defold.com/t/luarocks-install-on-windows/70519/2 "2022-03-11T09:30:42Z")

</div>

Have you tried chocolatey for installing [Lua](https://community.chocolatey.org/packages/lua)/[LuaRocks](https://community.chocolatey.org/packages/luarocks)?  
(I.e. `choco install lua`/ `choco install luarocks`)

(I’m going to try later on my windows machine as well.)

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [March 11, 2022, 9:37am UTC](https://forum.defold.com/t/luarocks-install-on-windows/70519/3 "2022-03-11T09:37:29Z")

</div>

No)  
I try intall it:  
1)from luarocks site. Luarocks with embedded lua in one package but have problems(  
2)also I try python wrapper(do not remember it name) that download and install lua and luarocks.  
3)Some packages with lua, and luarocks from other websites.

For me only that guide was worked)

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 11, 2022, 10:13am UTC](https://forum.defold.com/t/luarocks-install-on-windows/70519/4 "2022-03-11T10:13:51Z")

</div>

I just did this on my Windows machine (if it’s any help to our users):

Open a `command prompt` as Administrator.  
I already have [chocolatey](https://community.chocolatey.org/) (a package manager for windows) installed.

Then I run:

```lua
choco install lua -y
choco install luarocks -y

```

After opening a new terminal/command prompt, I can now use the tools:

```lua
$ luarocks.exe --version
C:\ProgramData\chocolatey\lib\luarocks\luarocks-2.4.4-win32\luarocks.lua 2.4.4
LuaRocks main command-line interface

```

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [March 11, 2022, 10:16am UTC](https://forum.defold.com/t/luarocks-install-on-windows/70519/5 "2022-03-11T10:16:39Z")

</div>

What about install dependencies. For example luafilesystem?

You also need compiler?

---

<div class="post-metadata">

**Author:** ![Mathias\_Westerdahl](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/mathias_westerdahl/32/228_2.png) [@Mathias\_Westerdahl](https://forum.defold.com/u/Mathias_Westerdahl)\
**Post date:** [March 11, 2022, 10:28am UTC](https://forum.defold.com/t/luarocks-install-on-windows/70519/6 "2022-03-11T10:28:55Z")

</div>

If it needs to compile, then yes you need to run it in an environment that has that support.

E.g. I start the “x86 Native Tools Command Prompt for VS 2022”, which is installed when I install the Visual Studio Community. This command prompt sets up the paths etc in order to run “cl.exe”. Then I run:

```lua
$ luarocks.exe install --local luafilesystem

```

But honestly, I wonder why luarocks doesn’t provide prebuilt binaries, since that’s what I’d expect from a package manager…

---

<div class="post-metadata">

**Author:** ![d954mas](https://forum-defold.b-cdn.net/user_avatar/forum.defold.com/d954mas/32/5401_2.png) [@d954mas](https://forum.defold.com/u/d954mas)\
**Post date:** [March 11, 2022, 10:32am UTC](https://forum.defold.com/t/luarocks-install-on-windows/70519/7 "2022-03-11T10:32:52Z")

</div>

Cool) Chocolatey is awesome))
