4

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?

1
  • 4
    I've seen that when the name of the project I'm working on matches the name of a module I'm installing via npm. Commented May 17, 2014 at 16:08

2 Answers 2

10

Ensure your app package.json name is not redis.


Good package.json

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

Bad package.json

{ "name": "redis" //... } 
Sign up to request clarification or add additional context in comments.

Comments

2

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.