Closed shippudean closed 3 years ago
Did you installed Minyami via npm? Which command did you use?
Yes! The command that I used to install is
npm install -g minyami
Have you tried to add npm's global binary folder to the PATH? You can get the path by npm bin -g
.
I tried to type npm bin -g
and it says
/Users/(myname)/.npm-global/bin (not in PATH env variable)
That does mean it is not on PATH, yet? I tried following the simple coding from https://stackoverflow.com/questions/46058546/error-eacces-permission-denied-access-usr-lib-node-modules and it worked when I typed minyami --help
BUT, once I opened a new tab on my terminal and typed minyami --help
, the command is not working unless I re-type the coding from that stackoverflow thread đ
Here are the codes:
- On the command line, in your home directory, create a directory for global installations:
mkdir ~/.npm-global
- Configure npm to use the new directory path:
npm config set prefix '~/.npm-global'
- In your preferred text editor, open or create a ~/.profile file and add this line:
export PATH=~/.npm-global/bin:$PATH
- On the command line, update your system variables:
source ~/.profile
You need to add export PATH=~/.npm-global/bin:$PATH
to the configuration files of your shell. By default it's .bashrc
and if you are using zsh please use .zshrc
.
https://stackoverflow.com/questions/45596833/bashrc-save-for-export
I've already typed export PATH=~/.npm-global/bin:$PATH
but whenever I tried to put on a new Bash session, the minyami --help
still won't be running.
And how do I know if I'm using zsh? đ¤
I mean you should add export PATH=~/.npm-global/bin:$PATH
to your .bashrc
, not justing executing it.
You can execute echo $SHELL
to know the current shell you are using.
Typed echo $SHELL
and it says /bin/bash
. Does that mean I'm using .bashrc
?
May I know how do I add export PATH=~/.npm-global/bin:$PATH
to my .bashrc
? I'm new to this coding so I'm just following an easier tutorial to understand đ
Try this. echo 'export PATH="~/.npm-global/bin:$PATH"' >> ~/.bashrc
Then start a new terminal tab to test if it's working.
Typed echo 'export PATH="PATH=~/.npm-global/bin:$PATH"' >> ~/.bashrc
and when I typed minyami --help
in a new terminal tab, it's not working and give me the same following:
-bash: minyami: command not found
Well.. That's strange.
Could you try the following steps and provide some information?
npm i -g minyami
whereis minyami
The output should be /Users/(your_username)/.npm-global/bin/minyami
By the way, this is not a problem of Minyami. I think there were something wrong when you were installing Node. Have you tried re-installing Node?
For npm i -g minyami
the result says
changed 56 packages, and audited 57 packages in 6s
1 package is looking for funding run
npm fund
for detailsfound 0 vulnerabilities
But when I typed whereis minyami
, it just gives me a blank:
192:~ myusername$
đ
Yes! I have reinstalled Node from the official website (the latest version) and from Homebrew (which doesn't work and people suggested downloading from the official site instead).
Sorry I don't have any idea about your situation... Maybe you can start a thread on Stackoverflow with the information above. Since this is not a problem of Minyami, I will close this issue later.
Thank you for your fast response and replies!
Cloud you please try find ~ -name minyami
and paste the output?
Typed find ~ -name minyami
and It says
find: /Users/myusername/Library/Application Support/MobileSync: Operation not permitted
find: /Users/myusername/Library/Application Support/CallHistoryTransactions: Operation not permitted
find: /Users/myusername/Library/Application Support/com.apple.TCC: Operation not permitted
find: /Users/myusername/Library/Application Support/CallHistoryDB: Operation not permitted
find: /Users/myusername/Library/IdentityServices: Operation not permitted
find: /Users/myusername/Library/Messages: Operation not permitted
find: /Users/myusername/Library/HomeKit: Operation not permitted
find: /Users/myusername/Library/Mail: Operation not permitted
find: /Users/myusername/Library/Safari: Operation not permitted
find: /Users/myusername/Library/Suggestions: Operation not permitted
find: /Users/myusername/Library/Containers/com.apple.Safari: Operation not permitted
find: /Users/myusername/Library/PersonalizationPortrait: Operation not permitted
find: /Users/myusername/Library/Metadata/CoreSpotlight: Operation not permitted
find: /Users/myusername/Library/Cookies: Operation not permitted
find: /Users/myusername/Library/Caches/com.apple.safaridavclient: Operation not permitted
find: /Users/myusername/Library/Caches/com.apple.HomeKit.configurations: Operation not permitted
find: /Users/myusername/Library/Caches/CloudKit/com.apple.Safari: Operation not permitted
find: /Users/myusername/Library/Caches/com.apple.Safari: Operation not permitted
/Users/myusername/.Trash/node_modules/.bin/minyami
/Users/myusername/.Trash/node_modules/minyami
/Users/myusername/.npm-global/bin/minyami
/Users/myusername/.npm-global/lib/node_modules/minyami
ls -l ~/.npm-global/bin/
and echo $SHELL; echo $PATH
please.
Sorry I have a typo in https://github.com/Last-Order/Minyami/issues/67#issuecomment-775207001
The correct command should be echo 'export PATH="~/.npm-global/bin:$PATH"' >> ~/.bashrc
As for ls -l ~/.npm-global/bin/
here's the output:
total 0
lrwxr-xr-x 1 myusername staff 47 Feb 8 21:21 awsmobile -> ../lib/node_modules/awsmobile-cli/bin/awsmobile
lrwxr-xr-x 1 myusername staff 57 Feb 8 21:21 awsmobile-configure -> ../lib/node_modules/awsmobile-cli/bin/awsmobile-configure
lrwxr-xr-x 1 myusername staff 55 Feb 8 21:21 awsmobile-console -> ../lib/node_modules/awsmobile-cli/bin/awsmobile-console
lrwxr-xr-x 1 myusername staff 54 Feb 8 21:21 awsmobile-delete -> ../lib/node_modules/awsmobile-cli/bin/awsmobile-delete
lrwxr-xr-x 1 myusername staff 56 Feb 8 21:21 awsmobile-features -> ../lib/node_modules/awsmobile-cli/bin/awsmobile-features
lrwxr-xr-x 1 myusername staff 52 Feb 8 21:21 awsmobile-init -> ../lib/node_modules/awsmobile-cli/bin/awsmobile-init
lrwxr-xr-x 1 myusername staff 55 Feb 8 21:21 awsmobile-publish -> ../lib/node_modules/awsmobile-cli/bin/awsmobile-publish
lrwxr-xr-x 1 myusername staff 52 Feb 8 21:21 awsmobile-pull -> ../lib/node_modules/awsmobile-cli/bin/awsmobile-pull
lrwxr-xr-x 1 myusername staff 52 Feb 8 21:21 awsmobile-push -> ../lib/node_modules/awsmobile-cli/bin/awsmobile-push
lrwxr-xr-x 1 myusername staff 51 Feb 8 21:21 awsmobile-run -> ../lib/node_modules/awsmobile-cli/bin/awsmobile-run
lrwxr-xr-x 1 myusername staff 53 Feb 8 21:21 awsmobile-start -> ../lib/node_modules/awsmobile-cli/bin/awsmobile-start
lrwxr-xr-x 1 myusername staff 37 Feb 8 21:33 jshint -> ../lib/node_modules/jshint/bin/jshint
lrwxr-xr-x 1 myusername staff 41 Feb 8 22:12 minyami -> ../lib/node_modules/minyami/dist/index.js
lrwxr-xr-x 1 myusername staff 38 Feb 8 21:25 tsc -> ../lib/node_modules/typescript/bin/tsc
lrwxr-xr-x 1 myusername staff 43 Feb 8 21:25 tsserver -> ../lib/node_modules/typescript/bin/tsserver
And for the echo $SHELL; echo $PATH
:
/bin/bash
/opt/local/bin:/opt/local/sbin:/usr/local/opt/python/libexec/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Sorry I have a typo in #67 (comment) The correct command should be
echo 'export PATH="~/.npm-global/bin:$PATH"' >> ~/.bashrc
Still not working and giving me the:
-bash: minyami: command not found
when I open a new terminal tab đ
Try ~/.npm-global/bin/minyami --version
.
Typed ~/.npm-global/bin/minyami --version
and it says:
Minyami / A lovely video downloader / 4.0.0
ãããĢãã~ (č>Ī<)
but still not working when I typed minyami --help
Sorry I have a typo in #67 (comment)
The correct command should be
echo 'export PATH="~/.npm-global/bin:$PATH"' >> ~/.bashrc
Still not working and giving me the:
-bash: minyami: command not found
when I open a new terminal tab đ
cat ~/.bashrc
please.
For cat ~/.bashrc
it says:
export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/opt/python/libexec/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/myusername/.npm-global/bin
export PATH="PATH=~/.npm-global/bin:$PATH"
export PATH="PATH=~/.npm-global/bin:$PATH"
export PATH="~/.npm-global/bin:$PATH"
export PATH="~/.npm-global/bin:$PATH"
Please type mv ~/.bashrc ~/.bashrc.bak && echo 'export ~/.npm-global/bin:$PATH' > ~/.bashrc
and try minyami --version
.
This will backup your original bashrc file and create a new one, in case you may have some other code in it.
After I typed mv ~/.bashrc ~/.bashrc.bak && echo 'export ~/.npm-global/bin:$PATH' > ~/.bashrc
and tried minyami --version
, it still says:
-bash: minyami: command not found
âšī¸
Type source ~/.bashrc
and try minyami again please.
Oh, my fault. Sorry.
Please type mv ~/.bashrc ~/.bashrc.bak1 && echo 'export PATH=~/.npm-global/bin:$PATH' > ~/.bashrc
.
I first typed: mv ~/.bashrc ~/.bashrc.bak1 && echo 'export PATH=~/.npm-global/bin:$PATH' > ~/.bashrc
Then, source ~/.bashr
and says:
-bash: /Users/myusername/.bashr: No such file or directory
And then, minyami --version
:
-bash: minyami: command not found
đŖ
I first typed: `mv ~/.bashrc ~/.bashrc.bak1 && echo 'export PATH=~/.npm-global/bin:$PATH' > ~/.bashrc
`
Then,
source ~/.bashr
and says:
-bash: /Users/myusername/.bashr: No such file or directory
And then,
minyami --version
:
-bash: minyami: command not found
đŖ
It should be source ~/.bashrc
, you missed a c
.
Oh! My bad! Just did the steps:
mv ~/.bashrc ~/.bashrc.bak1 && echo 'export PATH=~/.npm-global/bin:$PATH' > ~/.bashrc
source ~/.bashrc
minyami --version
And the output is:
Minyami / A lovely video downloader / 4.0.0
ãããĢãã~ (č>Ī<)
But the issue is still the same when I typed minyami --version
or minyami --help
, both are not working in a new terminal tab. Like, I should re-type those following steps again to run minyami in a new terminal tab đ
Okay. So now when bashrc is sourced, PATH
is properly exported.
The question is, ~/.bashrc
is not automaticly sourced when you enter your bash session, which should be normally.
How do you enter your bash session?
I just click +
to create a new tab
on my terminal and I saw it loading to login
.
So I figured minyami won't start automatically in the new bash session unless I re-type those following steps.
Which terminal app do you use? And...
I saw it loading to
login
? Why login? Are you running terminal on some kind of virtual environment instead of macos native terminal? If so, bashrc file may not be sourced automaticlly, like using WSL1 under Windows.
Try this.
echo '[ -r ~/.bashrc ] && . ~/.bashrc' >> ~/.bash_profile
Which terminal app do you use? And...
I saw it loading to
login
? Why login? Are you running terminal on some kind of virtual environment instead of macos native terminal? If so, bashrc file may not be sourced automaticlly, like using WSL1 under Windows.
(Apologize for the delay, it was late at midnight in my GMT and now I'm awake)
No, I'm running on macOS native terminal. What I meant is like this: the login
after I clicked +
before it started to appear as ~ --bash
tab video.
So I'm confused why it won't run automatically when I opened a new terminal tab đĸ
Try this.
echo '[ -r ~/.bashrc ] && . ~/.bashrc' >> ~/.bash_profile
I typed this and it works, but it doesn't when I opened a new tab like this: video
Here I provided you with a video for better understanding on my issues đ
Sorry for the delay. Github didn't mail me so I thought you didn't reply.
In your first video, you ran minyami --help
in Tab 2, then open the new Tab, Tab 3.
In the second, xxxxx > ~/.bash_profile
and minyami --version
was typed in Tab 2, and minyami --version
ran in Tab 3.
You see, Tab 3 is opened before you type 'bash_profile' bunch of stuff, so the bash session in Tab 3 is not affected by the modification made afterwards in Tab 2.
So you should open a new Tab, like Tab 4, after you type those in Tab 2, to observe the difference.
Thank you! So the only thing for Minyami to run in a new terminal tab is by typing echo '[ -r ~/.bashrc ] && . ~/.bashrc' >> ~/.bash_profile
then try to test with minyami --version
?
No.
In theory, you only have to run echo '[ -r ~/.bashrc ] && . ~/.bashrc' >> ~/.bash_profile
once.
And all the bash session opened after this should automatically add npm global bin path to $PATH. Then you can type minyami
without pre path.
If not, there may be other things gone wrong, which I may not be good enough to help you with.
OMG! I just tested in a new terminal by typing minyami
without running echo '[ -r ~/.bashrc ] && . ~/.bashrc' >> ~/.bash_profile
and it works like a charm đ!!
Thank you so much for the patience in teaching me, tuzi3040!! Grateful for your help!!
It's okay. I'm glad that I can help you.
Basic Information:
I've been encountering this stressful issue whenever I'm trying to run Minyami.
When I type
minyami --help
to test Minyami, I always face with-bash: minyami: command not found
when it's already installed on my Mac. Therefore this resulted in me reinstalling it again and again on my terminal whenever I try to use Minyami.How to solve this issue so I run Minyami smoothly without reinstalling it again?