nvim-lua / kickstart.nvim

A launch point for your personal nvim configuration
MIT License
20.06k stars 24.43k forks source link

Modules not found upon fresh installation of nvim #83

Closed lxwbr closed 1 year ago

lxwbr commented 1 year ago

Describe the bug After fresh installation of nvim and using the kickstart script I get errors below. Some modules seem to not be found.

To Reproduce Steps to reproduce the behavior:

  1. Copy current master version of init.lua to ~/.config/nvim/init.lua.
  2. Run nvim, wait until packer deps are installed
  3. Exit nvim
  4. Run nvim again

Desktop (please complete the following information):

Neovim Version

Error detected while processing /Users/alex/.config/nvim/init.lua:                                                                                                                                                    
E5113: Error while calling lua chunk: ...cker/start/nvim-treesitter/lua/nvim-treesitter/query.lua:2: module 'vim.treesitter.query' not found:                                                                         
        no field package.preload['vim.treesitter.query']                                                                                                                                                              
        no file './vim/treesitter/query.lua'                                                                                                                                                                          
        no file '/Users/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1.0-beta3/vim/treesitter/query.lua'                                                                                                        
        no file '/usr/local/share/lua/5.1/vim/treesitter/query.lua'                                                                                                                                                   
        no file '/usr/local/share/lua/5.1/vim/treesitter/query/init.lua'                                                                                                                                              
        no file '/Users/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/vim/treesitter/query.lua'                                                                                                                   
        no file '/Users/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/vim/treesitter/query/init.lua'                                                                                                              
        no file './vim/treesitter/query.so'                                                                                                                                                                           
        no file '/usr/local/lib/lua/5.1/vim/treesitter/query.so'                                                                                                                                                      
        no file '/Users/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/vim/treesitter/query.so'                                                                                                                      
        no file '/usr/local/lib/lua/5.1/loadall.so'                                                                                                                                                                   
        no file './vim.so'                                                                                                                                                                                            
        no file '/usr/local/lib/lua/5.1/vim.so'                                                                                                                                                                       
        no file '/Users/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/vim.so'                                                                                                                                       
        no file '/usr/local/lib/lua/5.1/loadall.so'                                                                                                                                                                   
stack traceback:                                                                                                                                                                                                      
        [C]: in function 'require'                                                                                                                                                                                    
        ...cker/start/nvim-treesitter/lua/nvim-treesitter/query.lua:2: in main chunk                                                                                                                                  
        [C]: in function 'require'                                                                                                                                                                                    
        ...er/start/nvim-treesitter/lua/nvim-treesitter/configs.lua:3: in main chunk                                                                                                                                  
        [C]: in function 'require'                                                                                                                                                                                    
        /Users/alex/.config/nvim/init.lua:222: in main chunk                                                                                                                                                          
E484: Can't open file /share/nvim/syntax/syntax.vim                                                                                                                                                                   
Error in packer_compiled: /Users/alex/.config/nvim/plugin/packer_compiled.lua:206: Vim(packadd):E5113: Error while calling lua chunk: vim/_init_packages.lua:0: module 'vim.treesitter' not found:^@^Ino field package
.preload['vim.treesitter']^@^Ino file './vim/treesitter.lua'^@^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1.0-beta3/vim/treesitter.lua'^@^Ino file '/usr/local/share/lua/5.1/vim/treesitter.l
ua'^@^Ino file '/usr/local/share/lua/5.1/vim/treesitter/init.lua'^@^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/vim/treesitter.lua'^@^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/shar
e/lua/5.1/vim/treesitter/init.lua'^@^Ino file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/vim/treesitter.lua'^@^Ino file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/v
im/treesitter/init.lua'^@^Ino file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/vim/treesitter.lua'^@^Ino file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rock
s-5.1/vim/treesitter/init.lua'^@^Ino file './vim/treesitter.so'^@^Ino file '/usr/local/lib/lua/5.1/vim/treesitter.so'^@^Ino file '/Users/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/vim/treesitter.so'^@^Ino file
 '/usr/local/lib/lua/5.1/loadall.so'^@^Ino file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/vim/treesitter.so'^@^Ino file './vim.so'^@^Ino file '/usr/local/lib/lua/5.1/vim.so'^@^Ino file '/Use
rs/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/vim.so'^@^Ino file '/usr/local/lib/lua/5.1/loadall.so'^@^Ino file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/vim.so'^@stack traceback:^@^I[C
]: in function 'require'^@^Ivim/_init_packages.lua: in function '__index'^@^I...er/start/nvim-treesitter/lua/nvim-treesitter/parsers.lua:2: in main chunk^@^I[C]: in function 'require'^@^I...er/start/nvim-treesitter
/lua/nvim-treesitter/install.lua:6: in main chunk^@^I[C]: in function 'require'^@^I...ack/packer/start/nvim-treesitter/lua/nvim-treesitter.lua:1: in main chunk^@^I[C]: in function 'require'^@^I.../packer/start/nvim
-treesitter/plugin/nvim-treesitter.lua:9: in main chunk^@^I[C]: in function 'cmd'^@^I/Users/alex/.config/nvim/plugin/packer_compiled.lua:206: in function </Users/alex/.config/nvim/plugin/packer_compiled.lua:10>^@^I
[C]: in function 'pcall'^@^I/Users/alex/.config/nvim/plugin/packer_compiled.lua:10: in main chunk                                                                                                                     
Please check your config for correctness
Error detected while processing /Users/alex/.local/share/nvim/site/pack/packer/start/nvim-lspconfig/plugin/lspconfig.lua:                                                                                             
E5113: Error while calling lua chunk: vim/_init_packages.lua:0: module 'vim.lsp' not found:                                                                                                                           
        no field package.preload['vim.lsp']                                                                                                                                                                           
        no file './vim/lsp.lua'                                                                                                                                                                                       
        no file '/Users/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1.0-beta3/vim/lsp.lua'                                                                                                                     
        no file '/usr/local/share/lua/5.1/vim/lsp.lua'                                                                                                                                                                
        no file '/usr/local/share/lua/5.1/vim/lsp/init.lua'                                                                                                                                                           
        no file '/Users/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/vim/lsp.lua'                                                                                                                                
        no file '/Users/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/vim/lsp/init.lua'                                                                                                                           
        no file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/vim/lsp.lua'                                                                                                                      
        no file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/vim/lsp/init.lua'                                                                                                                 
        no file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/vim/lsp.lua'                                                                                                             
        no file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/vim/lsp/init.lua'                                                                                                        
        no file './vim/lsp.so'                                                                                                                                                                                        
        no file '/usr/local/lib/lua/5.1/vim/lsp.so'                                                                                                                                                                   
        no file '/Users/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/vim/lsp.so'                                                                                                                                   
        no file '/usr/local/lib/lua/5.1/loadall.so'                                                                                                                                                                   
        no file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/vim/lsp.so'                                                                                                                         
        no file './vim.so'                                                                                                                                                                                            
        no file '/usr/local/lib/lua/5.1/vim.so'                                                                                                                                                                       
        no file '/Users/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/vim.so'                                                                                                                                       
        no file '/usr/local/lib/lua/5.1/loadall.so'                                                                                                                                                                   
        no file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/vim.so'                                                                                                                             
stack traceback:                                                                                                                                                                                                      
        [C]: in function 'require'                                                                                                                                                                                    
        vim/_init_packages.lua: in function '__index'                                                                                                                                                                 
        ...te/pack/packer/start/nvim-lspconfig/plugin/lspconfig.lua:1: in main chunk                                                                                                                                  
Error detected while processing /Users/alex/.local/share/nvim/site/pack/packer/start/cmp_luasnip/after/plugin/cmp_luasnip.lua:                                                                                        
E5113: Error while calling lua chunk: ...e/pack/packer/start/cmp_luasnip/lua/cmp_luasnip/init.lua:2: module 'vim.lsp.util' not found:                                                                                 
        no field package.preload['vim.lsp.util']                                                                                                                                                                      
        no file './vim/lsp/util.lua'                                                                                                                                                                                  
        no file '/Users/runner/work/neovim/neovim/.deps/usr/share/luajit-2.1.0-beta3/vim/lsp/util.lua'                                                                                                                
        no file '/usr/local/share/lua/5.1/vim/lsp/util.lua'                                                                                                                                                           
        no file '/usr/local/share/lua/5.1/vim/lsp/util/init.lua'                                                                                                                                                      
        no file '/Users/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/vim/lsp/util.lua'                                                                                                                           
        no file '/Users/runner/work/neovim/neovim/.deps/usr/share/lua/5.1/vim/lsp/util/init.lua'                                                                                                                      
        no file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/vim/lsp/util.lua'                                                                                                                 
        no file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/vim/lsp/util/init.lua'                                                                                                            
        no file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/vim/lsp/util.lua'                                                                                                        
        no file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/vim/lsp/util/init.lua'                                                                                                   
        no file './vim/lsp/util.so'                                                                                                                                                                                   
        no file '/usr/local/lib/lua/5.1/vim/lsp/util.so'                                                                                                                                                              
        no file '/Users/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/vim/lsp/util.so'                                                                                                                              
        no file '/usr/local/lib/lua/5.1/loadall.so'                                                                                                                                                                   
        no file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/vim/lsp/util.so'                                                                                                                    
        no file './vim.so'                                                                                                                                                                                            
        no file '/usr/local/lib/lua/5.1/vim.so'                                                                                                                                                                       
        no file '/Users/runner/work/neovim/neovim/.deps/usr/lib/lua/5.1/vim.so'                                                                                                                                       
        no file '/usr/local/lib/lua/5.1/loadall.so'                                                                                                                                                                   
        no file '/Users/alex/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/vim.so'                                                                                                                             
stack traceback:                                                                                                                                                                                                      
        [C]: in function 'require'                                                                                                                                                                                    
        ...e/pack/packer/start/cmp_luasnip/lua/cmp_luasnip/init.lua:2: in main chunk                                                                                                                                  
        [C]: in function 'require'                                                                                                                                                                                    
        ...ck/packer/start/cmp_luasnip/after/plugin/cmp_luasnip.lua:1: in main chunk
craigmac commented 1 year ago

Something is up with your runtime path, if this is not the first time you've built Neovim from source then that's likely the issue. Retry from neovim source directory with: sudo make clean && make distclean, then sudo make CMAKE_BUILD_TYPE=Release, then sudo make install to completely remove any leftover runtime files (if this wasn't the first time you've built from source). I've got pretty much the exactly setup you have here and been hit with this before.

tjdevries commented 1 year ago

Also maybe try :TSUpdate it looks like some other tree-sitter errors, which might be from incompatible parsers.

lxwbr commented 1 year ago

@tjdevries Unfortunately I get a E492: Not an editor command: TSUpdate when trying to do so.

@craigmac so I did install nvim using brew in the past, then removed it at some point and did the isolated installation under $HOME/neovim building from source last time. I bet you're right that in all of that there was some mixup. Unfortunately clean and distclean didn't make any difference in my case

lxwbr commented 1 year ago

Sorry for all the confusion, I did have an nvim version in my ~/.local/bin and didn't realise that it was the one being used all the time instead of the freshly compiled one in ~/neovim. After cleaning up that one everything works as expected.