In the system there is a nodejs
, installed through nvm
. The command is not running npm
.
Console is Oh my zsh
相关问题
- Failed at the electron@1.8.2 postinstall script
- Webpack getting started, import error
- No member named ForceSet
- AWS Elastic BeanStalk nodejs Deployment error
- node local dependency installs as shortcut and nes
相关文章
- @angular-cli install fails with deprecated request
- Emacs/xterm color annoyance on Linux
- make GitX open via Terminal for the repo laying at
- Create React App not installing, showing an error
- new field false in Package.json
- npm : Postinstall not running in docker
- Babel CLI is extremely slow
- Docker and npm - gyp ERR! not ok
You can use zsh-nvm or enable it yourself by adding following lines to your ~/.zshrc
Extra:
For faster shell initialization, I use
lazynvm
which only loads node when neededReference: Lazy load nvm for faster shell start
I discovered that there is a nvm plug-in shipping with oh-my-zsh (that's different from lukechilds plugin). After short inspection, I think it adds the necessary modifications to
.zshrc
when loading, so simply addingnvm
to the plugins list in.zshrc
should work as well (and it does for me).I did not find any more details on that default nvm plugin via google so I don't know whether this is the "go-to" solution.
Switching from Bash to Oh-My-Zsh
If you already have
nvm
installed and you're switching frombash
tooh-my-zsh
you can simply open up your.zshrc
file and add thenvm
plugin that is included withoh-my-zsh
:.zshrc
in nano with this command:nano ~/.zshrc
plugins=(git)
and addnvm
inside the parentheses to make it show asplugins=(git nvm)
(separate plugins with spaces)control
+O
(on macOS), thenenter
, to save, then presscontrol
+X
to exitnvm ls
to confirm it works. Note that you must open a new window/tab for your shell to use the newly updated.zshrc
config (or entersource ~/.zshrc
, etc.)Source: https://github.com/robbyrussell/oh-my-zsh/tree/master/plugins/nvm
A much easier solution is to use the nvm plugin that is shipped by default:
git clone https://github.com/nvm-sh/nvm.git ~/.nvm
cd ~/.nvm && git checkout v0.35.1
(current latest release)nvm
to your~/.zshrc
. Ex:plugins=(... nvm)