Home > Blockchain >  Relative path command is not found
Relative path command is not found

Time:01-19

I have installed an nvim application in the /home/stephane/programs/install/bin/ directory.

I also removed a previous installation: sudo apt-get remove neovim

But I can only run at with the absolute path:

stephane@stephane-pc:~$ echo $PATH
/home/stephane/.asdf/shims:/home/stephane/.asdf/bin:/home/stephane/.sdkman/candidates/java/current/bin:/home/stephane/.nvm/versions/node/v15.12.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/stephane/dev/commands:/home/stephane/programs/install/bin:/home/stephane/programs/install/sbin:/home/stephane/programs/oracle/instantclient_11_2:/home/stephane/programs/flyway:/home/stephane/programs/apache-maven-3.6.3/bin:/home/stephane/programs/google-cloud-sdk/bin:/home/stephane/programs/install/mariadb/bin:/home/stephane/programs/dbeaver-ce-21.3.1:/home/stephane/programs/androidsdktools/tools/:/home/stephane/programs/androidsdktools/platform-tools/:/home/stephane/.config/composer/vendor/bin:/home/stephane/programs/go/bin:/home/stephane/dev/go/bin:/home/stephane/programs/kafka/apache-kafka/bin:/home/stephane/programs/FileZilla3/bin:/home/stephane/programs/teamviewer_11.0.258840
stephane@stephane-pc:~$ which nvim
/home/stephane/programs/install/bin/nvim
stephane@stephane-pc:~$ /home/stephane/programs/install/bin/nvim --version
NVIM v0.6.1
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-11 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=always -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/home/runner/work/neovim/neovim/build/config -I/home/runner/work/neovim/neovim/src -I/home/runner/work/neovim/neovim/.deps/usr/include -I/usr/include -I/home/runner/work/neovim/neovim/build/src/nvim/auto -I/home/runner/work/neovim/neovim/build/include
Compiled by runner@fv-az87-780

Features:  acl  iconv  tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "
/home/runner/work/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info
stephane@stephane-pc:~$ nvim --version
bash: /usr/bin/nvim: No such file or directory

When trying to run it with a relative path, that is, using the command name only, it fails to find it.

UPDATE: The type shows:

stephane@stephane-pc:~$ type -a nvim
nvim is /home/stephane/programs/install/bin/nvim

CodePudding user response:

It seems like your command nvim is only installed in your local folder. If you want to use it with the command name:

  • /home/stephane/programs/install/bin/ should be added to your $PATH (but it seems you already tried this)

OR

  • nvim should be installed in a proper directory e.g. /usr/local/bin/ which is already in $PATH.
    Can you try to do a symbolic link : ln -s /home/stephane/programs/install/bin/nvim /usr/local/bin/ or try to do a symbolic link in /usr/bin/

Does it help ?

CodePudding user response:

I just sourced the .bashrc file and it solved the issue.

It appears the PATH environment variable needed to be refreshed.

stephane@stephane-pc:~$ source ~/.bashrc
stephane@stephane-pc:~$ nvim --version
NVIM v0.6.1
  •  Tags:  
  • Related