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

no such file or directory #743

Open
aspizu opened this issue Dec 30, 2022 · 3 comments
Open

no such file or directory #743

aspizu opened this issue Dec 30, 2022 · 3 comments

Comments

@aspizu
Copy link

aspizu commented Dec 30, 2022

When trying to run any antigen command:

antigen:source:2: no such file or directory: /home/aspizu/antigen.zsh

installed antigen using the curl command and have this in ~/.zshrc -> source ~/.antigen.zsh

@webbb82
Copy link

webbb82 commented Apr 4, 2023

same issue here
plus
/.zshrc:105: command not found: antigen
a/antigen.zsh:source:2: no such file or directory: /home/llama/bin/antigen.zsh
archlinux%

@dandelion-sea
Copy link

dandelion-sea commented Apr 11, 2023

To anyone reading this answer: The project seems lack of maintaince, althought it runs well for now. You may consider choosing another plugin manager. I am still using Antigen just because it is easy to bundle with oh-my-zsh.

Solution

Same issue to me today, and I found a solution:

# remove old installation, please check before exec it
#rm -r .antigen .antigen.zsh

# and re-install by git clone
git clone https://github.com/zsh-users/antigen.git ~/.antigen

# add source line to .zshrc. you may edit .zshrc manually
echo 'source ~/.angiten/antigen.zsh' >> ~/.zshrc

# finally, source the new file(or restart your shell), 
# and wait for a while for antigen to prepare everything for you!
source ~/.zshrc

Detailed Reason

I was confused by the error message at first, until I ran which antigen and got output like:

antigen () {
        local MATCH MBEGIN MEND
        [[ "$ZSH_EVAL_CONTEXT" =~ "toplevel:*" || "$ZSH_EVAL_CONTEXT" =~ "cmdarg:*" ]] && source "/home/name/.antigen/antigen.zsh" && eval antigen $@
        return 0
}

and I search it in source code, and find something here.

The issue seems to be caused by the hard encoded path $_ANTIGEN_INSTALL_DIR/antigen.zsh in the cache file($ANTIGEN_CACHE, /home/name/.antigen/init.zsh by default).

So my first solution to this issue is modifying the .antigen.zsh like:

# not perfect solution, edit the .antigen.zsh and delete all old caches
sed -i "s/_ANTIGEN_INSTALL_DIR\/antigen.zsh/_ANTIGEN_INSTALL_DIR\/.antigen.zsh/g" .antigen.zsh
antigen reset

but this solution is not perfect too, some commands such like antigen selfupdate still have error. I think there are more hard-encoded path in the repo.

Finally, when I am wandering in the repo, I find a file named ./antigen.zsh, which you just need to source then evething will be ok. So the issues is solved happily, by the non-official installation method mentioned above.

@Young2men
Copy link

Hi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants