npm install redis problems

3k Views Asked by At

Having problems running npm install redis. Got error:

npm WARN install Refusing to install redis as a dependency of itself

When I tried to install hiredis it would appear to install just fine however, when I tried to run any of the examples they would fail with the required file "redis" not found.

I did finally solve this by installing redis global or:

npm install -g redis

Has anyone else seen this?

2

There are 2 best solutions below

0
On

Ensure your app package.json name is not redis.


Good package.json

{
  "name": "redis-app"
  //...
}

Bad package.json

{
  "name": "redis"
  //...
}
0
On

Matthew's comment is correct. This error will occur when your folder name is the same as an NPM module. So just change your folder name from redis to redisApp or something.