Skip to content

Cannot find luarocks to install treesitter modules #1809

Description

@linguini1

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

NVIM v0.12.1 Build type: Release LuaJIT 2.1.1774638290

Neorg setup

        require("neorg").setup({
            load = {
                ["core.esupports.metagen"] = {
                    config = {
                        author = "Matteo Golin",
                    },
                },
                ["core.defaults"] = {},
                ["core.qol.toc"] = { config = { close_after_use = true } },
                ["core.completion"] = { config = { engine = "nvim-cmp" } },
                ["core.summary"] = {},
                ["core.concealer"] = { config = { icons = { code_block = { conceal = true, width = 80 } } } },
                ["core.export"] = {},
                ["core.looking-glass"] = {},
                ["core.presenter"] = { config = { zen_mode = "zen-mode" } },
                ["core.integrations.telescope"] = {},
                ["core.integrations.treesitter"] = {},
                ["core.ui"] = {},
                ["core.tempus"] = {},
                ["core.ui.calendar"] = {},
                ["core.export.markdown"] = { config = { extensions = "all" } },
                ["core.journal"] = {
                    config = {
                        journal_folder = "journo",
                    },
                },
                ["core.dirman"] = {
                    config = {
                        workspaces = {
                            junk = "~/notes/junk",
                            school = "~/notes/school",
                            projects = "~/notes/projects",
                            cuinspace = "~/notes/cuinspace",
                        },
                        default_workspace = "junk",
                    },
                },
                ["core.keybinds"] = {
                    config = {
                        hook = function(keybinds)
                            keybinds.remap_event("norg", "n", "<LocalLeader>z", "core.looking-glass.magnify-code-block")
                            keybinds.map("norg", "n", "<LocalLeader>p", "<Cmd>Neorg presenter start<CR>")
                            keybinds.map("norg", "n", "<leader>fnh", "<Cmd>Telescope neorg search_headers<CR>")
                            keybinds.map("norg", "n", "<leader>fnl", "<Cmd>Telescope neorg find_linkable<CR>")
                            keybinds.map("norg", "n", "<LocalLeader>il", "<Cmd>Telescope neorg insert_file_link<CR>")

                            keybinds.remap_event("norg", "n", "]l", "core.integrations.treesitter.next.link")
                            keybinds.remap_event("norg", "n", "[l", "core.integrations.treesitter.previous.link")
                            keybinds.remap_event("norg", "n", "]h", "core.integrations.treesitter.next.heading")
                            keybinds.remap_event("norg", "n", "[h", "core.integrations.treesitter.previous.heading")
                        end,
                    },
                },
            },
        })

Actual behavior

Image

This is the error I receive when I open Neovim. I have installed the Lua for Windows package and luarocks is on the system path and is executable. I am not sure why the build process cannot find it.

I have also tried the luarocks.nvim package, which fails with this mysterious error:

Unable to load the luarocks package loader. Try re-running the build stage (`:Lazy build luarocks.nvim`). Full trace: ...\lazy\luarocks.nvim\.rocks\lua\luarocks\core\persist.
lua:5: module 'dkjson' not found:
        no field package.preload['dkjson']
        cache_loader: module 'dkjson' not found
        cache_loader_lib: module 'dkjson' not found
        no file '.\dkjson.lua'
        no file 'C:\Program Files\Neovim\bin\lua\dkjson.lua'
        no file 'C:\Program Files\Neovim\bin\lua\dkjson\init.lua'
        no file 'C:\Program Files (x86)\Lua\5.1\lua\dkjson.luac'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/telescope.nvim/share/lua/5.1/dkjson.lua'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/telescope.nvim/share/lua/5.1/dkjson/init.lua'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/tree-sitter-norg/share/lua/5.1/dkjson.lua'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/tree-sitter-norg/share/lua/5.1/dkjson/init.lua'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/tree-sitter-norg-meta/share/lua/5.1/dkjson.lua'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/tree-sitter-norg-meta/share/lua/5.1/dkjson/init.lua'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/pathlib.nvim/share/lua/5.1/dkjson.lua'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/pathlib.nvim/share/lua/5.1/dkjson/init.lua'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/neorg/share/lua/5.1/dkjson.lua'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/neorg/share/lua/5.1/dkjson/init.lua'
        no file 'C:\Users\matte\AppData\Local\nvim-data\lazy\luarocks.nvim\.rocks\share\lua\5.1\dkjson.lua'
        no file 'C:\Users\matte\AppData\Local\nvim-data\lazy\luarocks.nvim\.rocks\share\lua\5.1\dkjson\init.lua'
        no file 'C:\Users\matte\AppData\Local\nvim-data\lazy\luarocks.nvim\.rocks\lua\dkjson.lua'
        no file 'C:\Users\matte\AppData\Local\nvim-data\lazy\luarocks.nvim\.rocks\lua\dkjson\init.lua'
        no file '.\dkjson.dll'
        no file 'C:\Program Files\Neovim\bin\dkjson.dll'
        no file 'C:\Program Files\Neovim\bin\loadall.dll'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/telescope.nvim/lib/lua/5.1/dkjson.dll'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/telescope.nvim/lib64/lua/5.1/dkjson.dll'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/tree-sitter-norg/lib/lua/5.1/dkjson.dll'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/tree-sitter-norg/lib64/lua/5.1/dkjson.dll'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/tree-sitter-norg-meta/lib/lua/5.1/dkjson.dll'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/tree-sitter-norg-meta/lib64/lua/5.1/dkjson.dll'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/pathlib.nvim/lib/lua/5.1/dkjson.dll'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/pathlib.nvim/lib64/lua/5.1/dkjson.dll'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/neorg/lib/lua/5.1/dkjson.dll'
        no file 'C:\Users\matte\AppData\Local\nvim-data/lazy-rocks/neorg/lib64/lua/5.1/dkjson.dll'
        no file 'C:\Users\matte\AppData\Local\nvim-data\lazy\luarocks.nvim\.rocks\lib\lua\5.1\dkjson.dll'

I did try rerunning the build, and also tried installing luarocks install dkjson to see if that would help. No luck.

Expected behavior

Tree sitter modules are installed and everything is fine!

This is new behaviour since updating Neovim packages.

Steps to reproduce

Open Neovim with the aforementioned Neorg setup and observe that Lazy fails to install the tree-sitter modules.

Potentially conflicting plugins

I think this is self-contained with Neorg's build process failing to obtain luarocks.

Other information

I am using Windows 11 on an ARM64 device. The Lua 5.1 interpreter is on the path, as is the luarocks install I got via Lua for Windows. I performed the install with all options checked (C libraries and headers included).

Help

No

Implementation help

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssues related to bugs. Please attach a severity, a priority and category with this label.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions