I'm having some problems installing vows via npm in zsh. Here's what I get. I tried installing it with and without the -g option. Do you have any idea what's wrong here?
[❤ ~/Desktop/sauce-node-demo:master] npm install -g vows
npm http GET https://registry.npmjs.org/vows
npm http 304 https://registry.npmjs.org/vows
npm http GET https://registry.npmjs.org/eyes
npm http GET https://registry.npmjs.org/diff
npm http 304 https://registry.npmjs.org/eyes
npm http 304 https://registry.npmjs.org/diff
/usr/local/share/npm/bin/vows -> /usr/local/share/npm/lib/node_modules/vows/bin/vows
vows@0.6.4 /usr/local/share/npm/lib/node_modules/vows
├── eyes@0.1.8
└── diff@1.0.3
[❤ ~/Desktop/sauce-node-demo:master] vows
zsh: command not found: vows
Thanks
In my case, i installed node with NVM and after installing z Shell, node and nvm command didn't worked. So what worked for me was installing nvm again with this command :
Above commands installed nvm again, since node was already installed, it added the node path automatically in .zshrc file and everything worked.
For me the accepted answer for adding
export PATH=/usr/local/share/npm/bin:$PATH
to.zshrc
didn't work. I tried adding theNVM_DIR
as well which solved my issue.vi .bashrc
You will find a line like the following. Copy it.
export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
Paste the copied content to
.zshrc
fileI hope this solves your issue.
If you installed Node.js using Homebrew, npm binaries can be found in
/usr/local/share/npm/bin
. You should make sure this directory is in your PATH environment variable. So, in your~/.zshrc
file addexport PATH=/usr/local/share/npm/bin:$PATH
.Mac users only
assuming you installed nvm prior, and npm correctly
(step-by-step guide below on how to install it:
install nvm for Mac users ).
you need to:
Find the '.zshrc' file:
open ~
to access your home directory.Cmd + Shift + .
to show the hidden files in Finder.Edit the '.zshrc' file:
add:
source /Users/_user_Name_/.bash_profile
to the top of the file (where _user_Name_ stands for your user.Save the file, and close the Terminal window.
On Ubuntu, after installing ZSH, and prevously on the
bash
terminal installed Node or other packages,nano .zshrc
export PATH=$HOME/bin:/usr/local/bin:$PATH
This works for me, and without writting any line, and I think this option is available on Mac too.
add
source /home/YOUUSERNAME/.bash_profile
at the beginning of~/.zshrc
And all missing commands will be detected.
For Mac users : add
source /Users/YOUUSERNAME/.bash_profile