Noobie needs help with errors after building from source

Hey,
First off some general Info:
I already had nvim up and running on my machine built from source with plugins and LSP and all.
But today in a sudden strike of genius I thought why not update? So I did just that and called ‘sudo make install’ in the neovim folder. And now I get a lot of errors which I can’t make sense of. Already tried googleing but nothing I found related to my Issue…

I’m running neovim through WSL2.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

Following is a copypasta of my nvim runtimelog acquired by calling
‘nvim -V2nvim.log’

I’m not sure if this is the right means of asking for help so please be lenient.
Thanks in advance!

UPDATE: After the comment from @deforde I did some more research and found that I can change the filetype of the files that threw the E492 Error. with sudo vim /filename/ and then :set ff=unix those were solved after saving. I had to do vim with sudo otherwise It would throw an error: E45: ‘readonly’ option is set (add ! to override) opening vim as super user solved this.

I added my remaining error log at the bottom. I’m continuing my rsearch for now and I will update if I solve something.

FINAL UPDATE: trailing characters was an easy fix just looking at the line in the error message. I had to fix some more ^M Errors while installing my plugins but other than that it looks like that is the issue… I got the windows file format due to wsl and nvim didn’t like that… Although I don’t remember having to do this for my first install which is kind of weird but whatever… Everything is up and running again!! I’m so excited!

sourcing “/usr/local/share/nvim/runtime/ftplugin.vim”
Error detected while processing /usr/local/share/nvim/runtime/ftplugin.vim:
line 5:
E492: Not an editor command: ^M
line 6:
E15: Invalid expression: exists(“did_load_ftplugin”)^M
W22: Text found after :endfunction: ^M
line 38:
E171: Missing :endif
finished sourcing /usr/local/share/nvim/runtime/ftplugin.vim
sourcing “/usr/local/share/nvim/runtime/indent.vim”
Error detected while processing /usr/local/share/nvim/runtime/indent.vim:
line 5:
E492: Not an editor command: ^M
line 6:
E15: Invalid expression: exists(“did_indent_on”)^M
W22: Text found after :endfunction: ^M
line 33:
E171: Missing :endif
finished sourcing /usr/local/share/nvim/runtime/indent.vim
could not source “/etc/xdg/nvim/sysinit.vim”
could not source “$VIM/sysinit.vim”
could not source “/home/praderwslubuntu/.config/nvim/init.vim”
could not source “/etc/xdg//nvim/init.vim”
sourcing “/usr/local/share/nvim/runtime/filetype.lua”
finished sourcing /usr/local/share/nvim/runtime/filetype.lua
sourcing “/usr/local/share/nvim/runtime/filetype.vim”
Error detected while processing /usr/local/share/nvim/runtime/filetype.vim:
line 5:
E492: Not an editor command: ^M
line 7:
E15: Invalid expression: exists(“did_load_filetypes”)^M
W22: Text found after :endfunction: ^M
W22: Text found after :endfunction: ^M
line 2577:
E488: Trailing characters
line 2578:
E171: Missing :endif
finished sourcing /usr/local/share/nvim/runtime/filetype.vim
sourcing “/usr/local/share/nvim/runtime/syntax/syntax.vim”
Error detected while processing /usr/local/share/nvim/runtime/syntax/syntax.vim:
line 4:
E492: Not an editor command: ^M
line 7:
E492: Not an editor command: ^M
line 8:
E15: Invalid expression: !has(“syntax”)^M
line 44:
E171: Missing :endif
Interrupted
finished sourcing /usr/local/share/nvim/runtime/syntax/syntax.vim
not found in ‘packpath’: “plugin//*.vim"
not found in ‘packpath’: "plugin/
/.lua"
not found in ‘packpath’: "pack/
/start/"
not found in ‘packpath’: "start/

not found in runtime path: “plugin//*.vim"
not found in runtime path: "plugin/
/*.lua”
Reading ShaDa file “/home/praderwslubuntu/.local/share/nvim/shada/main.shada” info marks oldfiles
Writing ShaDa file “/home/praderwslubuntu/.local/share/nvim/shada/main.shada”

UPDATE log:

sourcing “/usr/local/share/nvim/runtime/ftplugin.vim”
finished sourcing /usr/local/share/nvim/runtime/ftplugin.vim
sourcing “/usr/local/share/nvim/runtime/indent.vim”
finished sourcing /usr/local/share/nvim/runtime/indent.vim
could not source “/etc/xdg/nvim/sysinit.vim”
could not source “$VIM/sysinit.vim”
sourcing “/home/praderwslubuntu/.config/nvim/init.vim”
line 2: sourcing “/usr/local/share/nvim/runtime/filetype.lua”
finished sourcing /usr/local/share/nvim/runtime/filetype.lua
continuing in /home/praderwslubuntu/.config/nvim/init.vim
line 2: sourcing “/usr/local/share/nvim/runtime/filetype.vim”
not found in runtime path: “ftdetect/.vim"
not found in runtime path: "ftdetect/
.lua”
finished sourcing /usr/local/share/nvim/runtime/filetype.vim
continuing in /home/praderwslubuntu/.config/nvim/init.vim
line 2: sourcing “/usr/local/share/nvim/runtime/ftplugin.vim”
finished sourcing /usr/local/share/nvim/runtime/ftplugin.vim
continuing in /home/praderwslubuntu/.config/nvim/init.vim
line 2: sourcing “/usr/local/share/nvim/runtime/indent.vim”
finished sourcing /usr/local/share/nvim/runtime/indent.vim
continuing in /home/praderwslubuntu/.config/nvim/init.vim
line 3: sourcing “/usr/local/share/nvim/runtime/filetype.lua”
finished sourcing /usr/local/share/nvim/runtime/filetype.lua
continuing in /home/praderwslubuntu/.config/nvim/init.vim
line 3: sourcing “/usr/local/share/nvim/runtime/filetype.vim”
finished sourcing /usr/local/share/nvim/runtime/filetype.vim
continuing in /home/praderwslubuntu/.config/nvim/init.vim
line 19: sourcing “/usr/local/share/nvim/runtime/filetype.lua”
finished sourcing /usr/local/share/nvim/runtime/filetype.lua
continuing in /home/praderwslubuntu/.config/nvim/init.vim
line 19: sourcing “/usr/local/share/nvim/runtime/filetype.vim”
finished sourcing /usr/local/share/nvim/runtime/filetype.vim
continuing in /home/praderwslubuntu/.config/nvim/init.vim
line 19: sourcing “/usr/local/share/nvim/runtime/ftplugin.vim”
finished sourcing /usr/local/share/nvim/runtime/ftplugin.vim
continuing in /home/praderwslubuntu/.config/nvim/init.vim
line 49: sourcing “/home/praderwslubuntu/.local/share/nvim/site/autoload/plug.vim”
finished sourcing /home/praderwslubuntu/.local/share/nvim/site/autoload/plug.vim
continuing in /home/praderwslubuntu/.config/nvim/init.vim
Error detected while processing /home/praderwslubuntu/.config/nvim/init.vim:
line 49:
E488: Trailing characters
line 14: sourcing “/usr/local/share/nvim/runtime/ftoff.vim”
finished sourcing /usr/local/share/nvim/runtime/ftoff.vim
continuing in function plug#end
line 83: sourcing “/usr/local/share/nvim/runtime/filetype.lua”
finished sourcing /usr/local/share/nvim/runtime/filetype.lua
continuing in function plug#end
line 83: sourcing “/usr/local/share/nvim/runtime/filetype.vim”
not found in runtime path: “ftdetect/.vim"
not found in runtime path: "ftdetect/
.lua”
finished sourcing /usr/local/share/nvim/runtime/filetype.vim
continuing in function plug#end
line 83: sourcing “/usr/local/share/nvim/runtime/ftplugin.vim”
finished sourcing /usr/local/share/nvim/runtime/ftplugin.vim
continuing in function plug#end
line 83: sourcing “/usr/local/share/nvim/runtime/indent.vim”
finished sourcing /usr/local/share/nvim/runtime/indent.vim
continuing in function plug#end
line 86: sourcing “/usr/local/share/nvim/runtime/syntax/syntax.vim”
line 19: sourcing “/usr/local/share/nvim/runtime/syntax/synload.vim”
finished sourcing /usr/local/share/nvim/runtime/syntax/synload.vim
continuing in /usr/local/share/nvim/runtime/syntax/syntax.vim
finished sourcing /usr/local/share/nvim/runtime/syntax/syntax.vim
continuing in function plug#end
not found in runtime path: “colors/gruvbox.vim”
not found in ‘packpath’: “pack//opt//colors/gruvbox.vim”
not found in ‘packpath’: “opt//colors/gruvbox.vim"
not found in runtime path: “colors/gruvbox.lua”
not found in ‘packpath’: "pack/
/opt//colors/gruvbox.lua"
not found in ‘packpath’: "opt/
/colors/gruvbox.lua”
line 97:
E185: Cannot find color scheme ‘gruvbox’
line 104:
E5108: Error executing lua /home/praderwslubuntu/.config/nvim/lua/nvim_config.lua:2: module ‘nvim-treesitter.configs’ not found:
no field package.preload[‘nvim-treesitter.configs’]
no file ‘./nvim-treesitter/configs.lua’
no file ‘/home/praderwslubuntu/neovim/.deps/usr/share/luajit-2.1.0-beta3/nvim-treesitter/configs.lua’
no file ‘/usr/local/share/lua/5.1/nvim-treesitter/configs.lua’
no file ‘/usr/local/share/lua/5.1/nvim-treesitter/configs/init.lua’
no file ‘/home/praderwslubuntu/neovim/.deps/usr/share/lua/5.1/nvim-treesitter/configs.lua’
no file ‘/home/praderwslubuntu/neovim/.deps/usr/share/lua/5.1/nvim-treesitter/configs/init.lua’
no file ‘./nvim-treesitter/configs.so’
no file ‘/usr/local/lib/lua/5.1/nvim-treesitter/configs.so’
no file ‘/home/praderwslubuntu/neovim/.deps/usr/lib/lua/5.1/nvim-treesitter/configs.so’
no file ‘/usr/local/lib/lua/5.1/loadall.so’
no file ‘./nvim-treesitter.so’
no file ‘/usr/local/lib/lua/5.1/nvim-treesitter.so’
no file ‘/home/praderwslubuntu/neovim/.deps/usr/lib/lua/5.1/nvim-treesitter.so’
no file ‘/usr/local/lib/lua/5.1/loadall.so’
stack traceback:
[C]: in function ‘require’
/home/praderwslubuntu/.config/nvim/lua/nvim_config.lua:2: in main chunk
[C]: in function ‘require’
[string “:lua”]:1: in main chunk
finished sourcing /home/praderwslubuntu/.config/nvim/init.vim
sourcing “/usr/local/share/nvim/runtime/plugin/gzip.vim”
finished sourcing /usr/local/share/nvim/runtime/plugin/gzip.vim
sourcing “/usr/local/share/nvim/runtime/plugin/health.vim”
finished sourcing /usr/local/share/nvim/runtime/plugin/health.vim
sourcing “/usr/local/share/nvim/runtime/plugin/man.vim”
finished sourcing /usr/local/share/nvim/runtime/plugin/man.vim
sourcing “/usr/local/share/nvim/runtime/plugin/matchit.vim”
not found in ‘packpath’: “pack//start/matchit"
line 3: sourcing “/usr/local/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim”
finished sourcing /usr/local/share/nvim/runtime/pack/dist/opt/matchit/plugin/matchit.vim
continuing in /usr/local/share/nvim/runtime/plugin/matchit.vim
finished sourcing /usr/local/share/nvim/runtime/plugin/matchit.vim
sourcing “/usr/local/share/nvim/runtime/plugin/matchparen.vim”
finished sourcing /usr/local/share/nvim/runtime/plugin/matchparen.vim
sourcing “/usr/local/share/nvim/runtime/plugin/netrwPlugin.vim”
finished sourcing /usr/local/share/nvim/runtime/plugin/netrwPlugin.vim
sourcing “/usr/local/share/nvim/runtime/plugin/rplugin.vim”
finished sourcing /usr/local/share/nvim/runtime/plugin/rplugin.vim
sourcing “/usr/local/share/nvim/runtime/plugin/shada.vim”
finished sourcing /usr/local/share/nvim/runtime/plugin/shada.vim
sourcing “/usr/local/share/nvim/runtime/plugin/spellfile.vim”
finished sourcing /usr/local/share/nvim/runtime/plugin/spellfile.vim
sourcing “/usr/local/share/nvim/runtime/plugin/tarPlugin.vim”
finished sourcing /usr/local/share/nvim/runtime/plugin/tarPlugin.vim
sourcing “/usr/local/share/nvim/runtime/plugin/tohtml.vim”
finished sourcing /usr/local/share/nvim/runtime/plugin/tohtml.vim
sourcing “/usr/local/share/nvim/runtime/plugin/tutor.vim”
finished sourcing /usr/local/share/nvim/runtime/plugin/tutor.vim
sourcing “/usr/local/share/nvim/runtime/plugin/zipPlugin.vim”
finished sourcing /usr/local/share/nvim/runtime/plugin/zipPlugin.vim
not found in ‘packpath’: "plugin/**/
.lua”
not found in ‘packpath’: “pack//start/
not found in ‘packpath’: “start/"
not found in runtime path: "plugin/**/
.vim”
not found in runtime path: “plugin/**/*.lua”
Reading ShaDa file “/home/praderwslubuntu/.local/share/nvim/shada/main.shada” info marks oldfilesrecording @Z
Writing ShaDa file “/home/praderwslubuntu/.local/share/nvim/shada/main.shada”

Looks like your issues may, at least partially, stem from unexpected line ending characters?

The ^M character is a carriage return, which forms part of line endings on Windows, but not on Linux.