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
Another thing to try and the answer for me was to uncomment the first
export
in~/.zshrc
# If you come from bash you might have to change your $PATH. export PATH=$HOME/bin:/usr/local/bin:$PATH
For Mac users:
Alongside the following: nvm, iterm2, zsh
I found using the
.bashrc
rather than.profile
or.bash_profile
caused far less issues.Simply by adding the latter to my
.zshrc
file:In my humble opinion, first, you have to make sure you have any kind of Node version installed. For that type:
And if you don't get any versions it means I was right :) Then you have to type:
** the actual version you can find in Node website
Then you will have Node and you will be able to use npm commands
for macOS users: consider using
.profile
instead of.bash_profile
. You may still need to manually add it to~/.zshrc
:Note that there is no such file by default! Quoting slhck https://superuser.com/a/473103:
The added value is that it feels good man to use a single file to set up the environment, regardless of the shell used. Loading a bash config file in zsh felt awkward.
Quoting an accepted answer by Cos https://stackoverflow.com/a/415444/2445063
Following Filip Ekberg's research / opinion https://stackoverflow.com/a/415410/2445063
getting back to slhck, a note of attention regarding bash:
I think the problem is more about the ZSH completion.
You need to add this line in your .zshrc:
If you have Oh-my-zsh, a PR has been made, you can integrate it until it is pulled: https://github.com/robbyrussell/oh-my-zsh/issues/3440