Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module 'lua-utils' not found (on LunarVim) #1530

Closed
2 tasks done
rxmmah opened this issue Jul 20, 2024 · 11 comments
Closed
2 tasks done

module 'lua-utils' not found (on LunarVim) #1530

rxmmah opened this issue Jul 20, 2024 · 11 comments
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.

Comments

@rxmmah
Copy link

rxmmah commented Jul 20, 2024

Prerequisites

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

Neovim Version

NVIM v0.10.0 Build type: Release LuaJIT 2.1.1716656478 Run "nvim -V1 -v" for more info

Neorg setup

{
"nvim-neorg/neorg",
config = function()
require('neorg').setup {
load = {
["core.defaults"] = {}, -- Load all the default modules
["core.norg.concealer"] = {}, -- Allows for use of icons
["core.norg.dirman"] = { -- Manage your directories with Neorg
config = {
workspaces = {
my_workspace = "~/notes",
obsidian = "/Obsidian"
},
default_workspace = "notes"
},
},
}, -- Your Neorg configuration
}
end,
}

Actual behavior

i can't call :Neorg command

Expected behavior

.

Steps to reproduce

.

Potentially conflicting plugins

No response

Other information

No response

Help

None

Implementation help

No response

@rxmmah rxmmah added the bug Issues related to bugs. Please attach a severity, a priority and category with this label. label Jul 20, 2024
@github-project-automation github-project-automation bot moved this to added-updated-reopened in sorting neorg issue tracker Jul 20, 2024
@NTBBloodbath
Copy link
Member

Hi, do you have luarocks installed in your system? It is a requirement to install neorg with lazy.nvim since v8.0 and perhaps you're missing it so lazy is unable to pull the plugin dependencies :)

@rxmmah
Copy link
Author

rxmmah commented Jul 21, 2024

@NTBBloodbath i have it installed and working

@andrewcrisp
Copy link

I notice your modules are using the 'core.norg.*' names. I saw in the docs that those were replaced. Try updating them to be:
["core.concealer"] = {}, -- Allows for use of icons
["core.dirman"] = { -- Manage your directories with Neorg

I don't remember where I found that breaking change, but it was mentioned somewhere.

I also see your Obsidian workspace is pointed at the root directory, which may be a typo. If that is supposed to be in your home directory, prepend a tilde (~).

Here is your config with those three changes:

{
	"nvim-neorg/neorg",
	config = function()
		require("neorg").setup({
			load = {
				["core.defaults"] = {}, -- Load all the default modules
				["core.concealer"] = {}, -- Allows for use of icons
				["core.dirman"] = { -- Manage your directories with Neorg
					config = {
						workspaces = {
							my_workspace = "~/notes",
							obsidian = "~/Obsidian",
						},
						default_workspace = "notes",
					},
				},
			}, -- Your Neorg configuration
		})
	end,
}

@lenninst
Copy link

Hello, I'm experiencing a similar issue

  1. I'm using Windows 11 with LunarVim and lazy.nvim.
  2. I recently updated from Neorg v7 (which was working correctly) to the latest version.
  3. I've tried multiple configurations, including the one suggested in this thread, but I'm still receiving the same error.

Configurations tried:

  1. Simple configuration:
{
    "nvim-neorg/neorg",
    lazy = false,
    version = "*",
    config = true,
}
  1. Detailed configuration:
{
    "nvim-neorg/neorg",
    build = ":Neorg sync-parsers",
    dependencies = { 
        "nvim-lua/plenary.nvim",
    },
    lazy = false,
    version = "*",
    config = function()
        require("neorg").setup {
            load = {
                ["core.defaults"] = {}, 
                ["core.concealer"] = {}, 
                ["core.dirman"] = { 
                    config = {
                        workspaces = {
                            notes = "C:/Users/YourUserName/Documents/notes",
                        },
                    },
                },
            },
        }
    end,
}
  1. Configuration suggested in this thread:
{
    "nvim-neorg/neorg",
    config = function()
        require("neorg").setup({
            load = {
                ["core.defaults"] = {}, 
                ["core.concealer"] = {}, 
                ["core.dirman"] = { 
                    config = {
                        workspaces = {
                            my_workspace = "~/notes",
                            --obsidian = "~/Obsidian",
                        },
                        default_workspace = "notes",
                    },
                },
            },
        })
    end,
}

Error received with all configurations:

Failed to run `config` for neorg
...unarvim/site/pack/lazy/opt/neorg/lua/neorg/core/init.lua:7: module 'lua-utils' not found:
no field package.preload['lua-utils']
cache_loader: module lua-utils not found
cache_loader_lib: module lua-utils not found
no file '.\lua-utils.lua'
no file 'C:\tools\neovim\nvim-win64\bin\lua\lua-utils.lua'
no file 'C:\tools\neovim\nvim-win64\bin\lua\lua-utils\init.lua'
no file 'C:\Users\kanguro\scoop\apps\lua\current\bin'

Additional information:

  • Neovim v0.10.1
  • LuaRocks 3.11.1 is installed and configured in the PATH
  • I've tried to manually install 'lua-utils' with LuaRocks
  • I've deleted all Neorg-related folders and reinstalled

🥲🥲
Should I open a new issue given that my case seems to be slightly different, or would you prefer I continue the discussion here? Any additional guidance would be greatly appreciated, especially considering I'm using Windows 11 with LunarVim.

@max397574
Copy link
Contributor

the problem is that lunarvim has pinned an old lazy.nvim version which isn't compatible with the current setup for neorg
so you either have to increase the lazy.nvim version or ping and old neorg version

@rxmmah rxmmah closed this as completed Aug 15, 2024
@github-project-automation github-project-automation bot moved this from added-updated-reopened to done in sorting neorg issue tracker Aug 15, 2024
@livexia
Copy link

livexia commented Aug 26, 2024

I found a method that might works

  1. first install old version of neorg(8.x.x)
  2. after successful install
  3. update the version to "*"

@rodhash
Copy link

rodhash commented Nov 14, 2024

Adding the 2 dependencies fixed it for me and seems to be working just fine:

    {
      "nvim-neorg/neorg",
      dependencies = {
        -- "luarocks.nvim",
        "nvim-neorg/lua-utils.nvim",
        "pysan3/pathlib.nvim",
      },
...

I do have rocks on my computer but now and then some other plugin faces issues with rocks, that's why I disabled that first dependency.

@khepin
Copy link

khepin commented Nov 16, 2024

Those 2 dependencies fixed it for me as well.

@thubtenrigzin
Copy link

thubtenrigzin commented Nov 16, 2024

Hello,

I had the same problem until I found that I've disabled luarock from my Lazy configuration.
Those 2 dependencies are not necessary with Lazy > 11
Just add these lines in your Lazy.setup():

require("lazy").setup({
    {
        "nvim-neorg/neorg",
        lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
        version = "*", -- Pin Neorg to the latest stable release
        config = true,
    }
}, {
    rocks = {
    enabled = true,
    hererocks = true,
  }
})

With that, the installation of those 2 modules will be added automatically

Hope it will work for all of you!

@rodhash
Copy link

rodhash commented Nov 17, 2024

Hello,

I had the same problem until I found that I've disabled luarock from my Lazy configuration. Those 2 dependencies are not necessary with Lazy > 11 Just add these lines in your Lazy.setup():

require("lazy").setup({
    {
        "nvim-neorg/neorg",
        lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
        version = "*", -- Pin Neorg to the latest stable release
        config = true,
    }
}, {
    rocks = {
    enabled = true,
    hererocks = true,
  }
})

With that, the installation of those 2 modules will be added automatically

Hope it will work for all of you!

You refer to rocks (not lazy) doing it automatically? Yeah I know, in fact on my personal computer I have it working fine.

But the thing is, rocks is a pain to make it work properly. Last week after getting my work computer replaced I got sick of losing hours on it so added them manually.

ps: I don't use any distrubution, I'm building my own so I don't have the luxury of someone else configuring it for me.

I read somewhere the biggest benefit of rocks would be dep management? Updates management? I don't see why Lazy is not enough for this, for me it works great in both situations. I hope someday rocks become so easy and friendly to use as Lazy is.

@max397574
Copy link
Contributor

I read somewhere the biggest benefit of rocks would be dep management? Updates management? I don't see why Lazy is not enough for this, for me it works great in both situations. I hope someday rocks become so easy and friendly to use as Lazy is.

The reason is that the user has to manage the dependencies
and not the plugin author

also see motivation for rocks.nvim
https://github.com/nvim-neorocks/rocks.nvim#grey_question-why-rocksnvim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues related to bugs. Please attach a severity, a priority and category with this label.
Projects
None yet
Development

No branches or pull requests

9 participants