norcalli / nvim-colorizer.lua

The fastest Neovim colorizer.
Other
2.25k stars 117 forks source link

Bug: ffi module not found #40

Open mainiac-knight opened 4 years ago

mainiac-knight commented 4 years ago

Neovim Version: 0.4.3 Lua Version: 5.3

E5105: Error while calling lua chunk: ...k/minpac/start/nvim-colorizer.lua/lua/colorizer/trie.lua:16: module 'ffi' not found: no field package.preload['ffi']
no file '/data/data/com.termux/files/home/.config/nvim/lua/ffi.lua'
no file '/data/data/com.termux/files/home/.config/nvim/lua/ffi/init.lua'
mangelozzi commented 4 years ago

I get the same thing (Using Neovim 0.5 by the way):

Error detected while processing /home/michael/.config/nvim/init/myplugins.vim:
line  359:                                                                                                                          
E5108: Error executing lua .../vim-plug/nvim-colorizer.lua//lua/colorizer/trie.lua:16: module 'ffi' not found:
        no field package.preload['ffi']
        no file '/home/michael/.config/nvim/lua/ffi.lua'
        no file '/home/michael/.config/nvim/lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-surround//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-surround//lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-commentary//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-commentary//lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-eunuch//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-eunuch//lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/ReplaceWithRegister//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/ReplaceWithRegister//lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-titlecase//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-titlecase//lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-unimpaired//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-unimpaired//lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/nvim-colorizer.lua//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/nvim-colorizer.lua//lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-fugitive//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-fugitive//lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/fzf//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/fzf//lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/fzf.vim//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/fzf.vim//lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-nerdtree-syntax-highlight//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-nerdtree-syntax-highlight//lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/nerdtree-git-plugin//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/nerdtree-git-plugin//lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/coc.nvim//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/coc.nvim//lua/ffi/init.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/SimpylFold//lua/ffi.lua'
        no file '/home/michael/.config/nvim/tmp/vim-plug/SimpylFold//lua/ffi/init.lua'                  
        no file '/etc/xdg/xdg-ubuntu/nvim/lua/ffi.so'
        no file '/etc/xdg/nvim/lua/ffi.so'
        no file '/home/michael/.local/share/nvim/site/lua/ffi.so'
        no file '/usr/share/ubuntu/nvim/site/lua/ffi.so'
        no file '/usr/local/share/nvim/site/lua/ffi.so'
        no file '/usr/share/nvim/site/lua/ffi.so'
        no file '/var/lib/snapd/desktop/nvim/site/lua/ffi.so'
        no file '/usr/share/nvim/runtime/lua/ffi.so'
        no file '/usr/lib/x86_64-linux-gnu/nvim/lua/ffi.so'
        no file '/var/lib/snapd/desktop/nvim/site/after/lua/ffi.so'
        no file '/usr/share/nvim/site/after/lua/ffi.so'
        no file '/usr/local/share/nvim/site/after/lua/ffi.so'
        no file '/usr/share/ubuntu/nvim/site/after/lua/ffi.so'
        no file '/home/michael/.local/share/nvim/site/after/lua/ffi.so'
        no file '/etc/xdg/nvim/after/lua/ffi.so'
        no file '/etc/xdg/xdg-ubuntu/nvim/after/lua/ffi.so'
        no file '/home/michael/.config/nvim/tmp/vim-plug/vim-nerdtree-syntax-highlight/after/lua/ffi.so'
        no file '/home/michael/.config/nvim/after/lua/ffi.so'
        no file './ffi.so'
        no file '/usr/local/lib/lua/5.1/ffi.so'
        no file '/usr/lib/x86_64-linux-gnu/lua/5.1/ffi.so'
        no file '/usr/lib/lua/5.1/ffi.so'
        no file '/usr/local/lib/lua/5.1/loadall.so'
m-sameer commented 4 years ago

I have this too

the-spanish-guy commented 4 years ago

I have the same problem Using neovim 0.4.3 btw

manish-baghel commented 4 years ago

Try checking if you are using nvim for opening file and not vim. Same issue happened to me but then I realized I was using vim filename.ext instead of nvim filename.ext

kuator commented 4 years ago

The most likely reason might be that those with this problem use ubuntu/debian version of neovim which doesn't include luajit which provides the ffi module.

ahauser31 commented 4 years ago

I have this same issue on a Mac, using neovim 0.4.3

@manish-baghel I'm sure I'm using nvim, even if I accidentally type vi or vim, I have it aliased to nvim anyway... @kuator I installed luajit using macports, and it's in the path.

However, searching for ffi.lua or ffi.so on my system does not yield any result, so maybe it is actually missing. However, I'm not sure where I would get it from, seeing that I have luajit installed and FFI is not available as a separate module...

kuator commented 4 years ago

@ahauser31 You don't need to install luajit on your system, neovim has it built-in. To check luajit version installed in neovim, run :lua print(jit.version). If it returns an error, then there might be a problem with your install. I would recommend appimage of neovim for those on ubuntu/debian.

manish-baghel commented 4 years ago

@ahauser31 ffi library is a standard module, there can't be a missing ffi as written in ffi documentation on luajit docs The FFI library is tightly integrated into LuaJIT (it's not available as a separate module)....

I'd recommend removing all lua and luajit binaries and installing neovim again as neovim comes with luajit built in as @kuator mentioned.

Also, if that doesn't work try to reproduce the error on a different system.

mangelozzi commented 4 years ago

Try checking if you are using nvim for opening file and not vim. Same issue happened to me but then I realized I was using vim filename.ext instead of nvim filename.ext

Im definately using Neovim. I dont even have vim.

mangelozzi commented 4 years ago

I built and installed https://luajit.org/install.html Version2.1.0beta3, and the error has finally gone away.

Seybo commented 4 years ago

i built and installed the same version as above and nothing has changed

wimstefan commented 3 years ago

Still have the same issue with the latest Neovim Nightly on a Gentoo system ...

wimstefan commented 3 years ago

Still have the same issue with the latest Neovim Nightly on a Gentoo system ...

And to reply to my own post: compiling Neovim with luajit enabled solves my problem as well :)

Delected commented 2 years ago

Still have the same issue with the latest Neovim Nightly on a Gentoo system ...

And to reply to my own post: compiling Neovim with luajit enabled solves my problem as well :)

sorry to revive an old issue, but how'd you get luajit enabled with neovim on gentoo? I added lua_single_target_luajit to my use flags and i recompiled neovim, but it gave me an error because neovim wants this flag to be disabled.

wimstefan commented 2 years ago

I've kept it very simple and put app-editors/neovim into /etc/portage/package.provided and installed neovim from the github repository with make CMAKE_BUILD_TYPE=RelWithDebInfo && make install

Might not be ideal for others but it worked perfectly for me :)

hunleyd commented 2 years ago

@Delected i added LUA_SINGLE_TARGET="luajit" to make.conf and then added package.use/lpeg:>=dev-lua/lpeg-1.0.2-r101 lua_targets_luajit and package.use/mpack:>=dev-lua/mpack-1.0.8-r100 lua_targets_luajit

Delected commented 2 years ago

thank you both! I will check out both of thede options later :)

On Wed, Oct 6, 2021 at 9:29 AM Douglas J Hunley @.***> wrote:

@Delected https://github.com/Delected i added LUA_SINGLE_TARGET="luajit" to make.conf and then added package.use/lpeg:>=dev-lua/lpeg-1.0.2-r101 lua_targets_luajit and package.use/mpack:>=dev-lua/mpack-1.0.8-r100 lua_targets_luajit

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/norcalli/nvim-colorizer.lua/issues/40#issuecomment-936237871, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN5MH2IZDQJ3NOVMFKQOLNTUFRFMZANCNFSM4MW4GRNQ .