redis-server - Command Not Found

npm install redis doesn't install redis, it installs a redis client for node. You need to install the redis server

On Windows:

I downloaded http://download.redis.io/redis-stable.tar.gz

tar xvzf redis-stable.tar.gz cd redis-stable make

I added this line to my .bash_profile:

export PATH=$PATH:$HOME/Downloads/redis-stable/src

restarted the terminal. Now can run redis-server

On Mac:

brew install redis


Make sure the command redis-server can use directly. If you install Redis before , find the path where your Redis install. eg : /home/prod/redis/redis-4.0.8/src/redis-server Then you can command this in terminal :

 ln -s /home/prod/redis/redis-4.0.8/src/redis-server /usr/bin/redis-server2

Note: path "/usr/bin" is your environment path .

cd /usr/bin ls -ltr you can see :

lrwxrwxrwx    1 root root         45 7月  12 11:05 redis-server -> /home/prod/redis/redis-4.0.8/src/redis-server

Now the command of redis-server can be used


npm install redis doesn't install redis, it installs a redis client for node. You need to install the redis server.


I downloaded http://download.redis.io/redis-stable.tar.gz

tar xvzf redis-stable.tar.gz
cd redis-stable
make

I added this line to my .bash_profile:

export PATH=$PATH:$HOME/Downloads/redis-stable/src

restarted the terminal. Now can run redis-server

Tags:

Node.Js

Redis